-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
52 lines (45 loc) · 1.63 KB
/
Main.java
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
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
BookServiceInterface service = new BookServices();
// Welcome msg and list of services
do{
System.out.println("\nWelcome to Library Management System");
System.out.println("\n1.Add Book\n"+
"2.Show All Books\n"+
"3.Show Available Books\n"+
"4.Borrow Book\n"+
"5.Return Book\n"+
"6.Exit\n");
// Enter your choice as int data according to the list show above
System.out.print("Enter Your Choice ! ");
int ch = sc.nextInt();
// For each operation method call using switch case
switch (ch) {
case 1:
service.addBook();
break;
case 2:
service.showAllBooks();
break;
case 3:
service.showAllAvailableBooks();
break;
case 4:
service.borrowBook();
break;
case 5:
service.returnBook();
break;
case 6:
System.out.println("\nThank you for visiting..!!");
System.exit(0);
break;
default:
System.out.print("\nPlease Enter Valid Choice ! ");
}
}
while(true);
}
}