-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClient.java
More file actions
33 lines (32 loc) · 905 Bytes
/
Copy pathClient.java
File metadata and controls
33 lines (32 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.util.Scanner;
public class Client{
public static void main(String args[]){
int ch;
Scanner in = new Scanner(System.in);
System.out.print("Enter the size of the list you want to create: ");
IntList list = new List(in.nextInt());
while(true){
System.out.print("1.Insert\n2.Delete\n3.Display\n4.Exit\nEnter your choice: ");
ch=in.nextInt();
System.out.println("__________________________________________");
switch(ch){
case 1:
System.out.print("Enter the key that you want to insert: ");
list.insert(in.nextInt());
break;
case 2:
System.out.print("Enter the key that you want to delete: ");
list.delete(in.nextInt());
break;
case 3:
list.display();
break;
case 4:
System.exit(0);
default:
System.out.print("Invalid\n");
}
System.out.println("__________________________________________");
}
}
}