-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
85 lines (79 loc) · 3.51 KB
/
Copy pathMain.java
File metadata and controls
85 lines (79 loc) · 3.51 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//Users of the System
//
// Admin
// Libraian
// Functional Requirements
//
// 1. Admin
// Can add/edit/view/delete librarian
// Can logout
// 2. Librarian
// Can add/edit/delete/view books
// Can issue books
// View issued books
import java.sql.SQLOutput;
import java.util.*;
import static java.lang.System.exit;
public class Main {
public static void main(String[] args) {
System.out.println("************* Welcome *************");
System.out.println("*** Chooce one of the options ***");
System.out.println("\t1.Librarian\n\t2.Admin\n");
Scanner temp = new Scanner(System.in);
int option = temp.nextInt();
if(option >= 4 && option <= 0){
System.out.println("Choose a VALID Option");
exit(0);
}
else{
switch (option){
case 1 :
System.out.print(" Welcome Librarian enter your name : ");
temp = new Scanner(System.in);
String name = temp.next();
System.out.println("\t1.AddBooks\n\t2.EditBooks\t3.IssueBooks\t\n4.ViewBooks");
System.out.print("Choose one of the above options : ");
temp = new Scanner(System.in);
int opt = temp.nextInt();
switch(opt){
case 1 :
System.out.print("Name of the book : ");
temp = new Scanner(System.in);
String bookName = temp.next();
System.out.print("Writer of the book : " );
temp = new Scanner(System.in);
String writerName = temp.next();
System.out.print("Cost of teh book : ");
temp = new Scanner(System.in);
int bookCost = temp.nextInt();
case 2 :
System.out.print("Name of the book : ");
temp = new Scanner(System.in);
bookName = temp.next();
System.out.print("Writer of the book : " );
temp = new Scanner(System.in);
writerName = temp.next();
System.out.print("Name of the book : ");
temp = new Scanner(System.in);
bookName = temp.next();
case 3 :
System.out.print("Enter the name of Student : ");
temp = new Scanner(System.in);
String studentNmae = temp.next();
System.out.print("Name of the book : ");
temp = new Scanner(System.in);
bookName = temp.next();
System.out.print("Number of days Borrowed : ");
temp = new Scanner(System.in);
int borrowDays = temp.nextInt();
case 4 :
System.out.println("*********** The List of the Books is below ***********");
}
case 2 :
System.out.print(" Welcome Admin enter your name : ");
temp = new Scanner(System.in);
name = temp.next();
}
}
}
}