forked from kishanrajput23/Java-Projects-Collections
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserMenu.java
More file actions
64 lines (57 loc) · 2.54 KB
/
Copy pathUserMenu.java
File metadata and controls
64 lines (57 loc) · 2.54 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import java.util.Scanner;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author testuser
*/
public class UserMenu {
public static void main(String[] args) {
String input="";
Scanner sc = new Scanner(System.in);
while(input != "5"){
System.out.println("---------------------------------------------------------");
System.out.println("---------------------------------------------------------");
System.out.println("---------------------------------------------------------");
System.out.println("Select the following options");
System.out.println("Enter 1 for adding a book");
System.out.println("Enter 2 for adding a member");
System.out.println("Enter 3 for issuing a book ");
System.out.println("Enter 4 for returning a book ");
System.out.println("Enter 5 to exit");
input = processUserInput(sc.nextLine().toString());
}
}
public static String processUserInput(String in) {
String retVal="5";
switch(in){
case "1":
System.out.println("---------------------------------------------------------");
System.out.println("You have selected option 1 to add a book");
AddBookMenu.addBookMenu();
return "1";
case "2":
System.out.println("---------------------------------------------------------");
System.out.println("You have selected option 2 to add a member");
AddMemberMenu.addMemberMenu();
return "2";
case "3":
System.out.println("---------------------------------------------------------");
System.out.println("You have selected option 3 to issue a book");
LibFunctions.callIssueMenu();
return "3";
case "4":
System.out.println("---------------------------------------------------------");
System.out.println("You have selected option 4 to return a book");
LibFunctions.callReturnMenu();
return "4";
default:
System.out.println("---------------------------------------------------------");
System.out.println("Thanks for working on this!!");
return "5";
}
}
}