import java.util.Scanner; public class ListString { static Scanner input = new Scanner(System.in); // --- return a List of Int --- public static List listBuild() { List list = new List(); Node pos = list.getFirst(); System.out.print("type a string (xxx to finish) --> "); String x = input.nextLine(); while (x.compareTo("xxx") != 0) { pos = list.insert(pos, x); System.out.print("type a string (xxx to finish) --> "); x = input.nextLine(); } return list; } //--- הפעולה מחזירה את מספר האיברים ברשימה public static int size(Listlst) { } //--- x הפעולה מחזירה את מספר המופעים של האיבר public static int howMany(Listlst , String x) { } // return true if x exist in lst and false if not public static boolean exist(List lst, String x) { } // return place of x in lst if exist // return null if not public static Node place(List lst, String x) { } public static void main(String[] args) { List lst = listBuild(); System.out.println(lst.toString()); int n=size(lst); System.out.println("size = "+n); System.out.print("type a num --> "); String x= input.nextLine(); System.out.println(x + " : מספר המופעים של"); System.out.println(howMany(lst,x)+" : הוא"); System.out.println(); System.out.print("type a num to find --> "); x= input.nextLine(); if (exist(lst,x)) { NodenamePlace = place(lst,x); System.out.println(namePlace.getInfo().toString()+" exist"); } else System.out.println(x+" does not exist"); } }