-
Notifications
You must be signed in to change notification settings - Fork 0
/
Management System.java
96 lines (92 loc) · 2.62 KB
/
Management System.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
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
86
87
88
89
90
91
92
93
94
95
96
// Post Office Management System
import java.util.*;
interface i1{
void adduser();
}
interface i2{
void update();
}
class post implements i1, i2{
public static void main(String args[]){
}
public void adduser(){
Scanner s = new Scanner(System.in);
Scanner l = new Scanner(System.in);
Scanner i = new Scanner(System.in);
System.out.println("Enter your name:");
String name = s.nextLine();
System.out.println("");
System.out.println("Enter your phone no.:");
long phone = l.nextLong();
System.out.println("");
System.out.println("Enter your age:");
int age = i.nextInt();
System.out.println("");
System.out.println("Enter your postal code:");
int postal_code = i.nextInt();
System.out.println("");
System.out.println("USER ADDED SUCCESSFULLY!");
}
public void update(){
Scanner s = new Scanner(System.in);
Scanner l = new Scanner(System.in);
Scanner i = new Scanner(System.in);
System.out.println("Enter your postal code:");
int postal_code = i.nextInt();
System.out.println("");
System.out.println("1. Name");
System.out.println("2. Phone no.");
System.out.println("3. age");
System.out.println("What you want to update:");
int up = i.nextInt();
System.out.println("");
switch(up){
case 1:
System.out.println("Enter new name:");
String n_name = s.nextLine();
break;
case 2:
System.out.println("Enter new phone no.:");
long n_ph = l.nextLong();
break;
case 3:
System.out.println("Enter new age:");
int n_age = i.nextInt();
break;
default:
System.out.println("Please enter give no. only!");
System.out.println("You are logged out!");
}
System.out.println("");
System.out.println("Details updated successfully!");
}
}
class f{
public static void main(String args[]){
System.out.println("*********Welcome to Post Office Management System*********");
System.out.println("");
post p = new post();
Scanner i = new Scanner(System.in);
System.out.println("************** WELCOME TO LOGIN PAGE **************");
System.out.println("");
System.out.println("Enter your 4 digit user id:");
int uid = i.nextInt();
System.out.println("");
System.out.println("Enter your 6 digit password:");
int pass = i.nextInt();
System.out.println("");
System.out.println("LOGIN SUCCESSFULLY!");
System.out.println("");
System.out.println("1. Add user");
System.out.println("2. Update user");
System.out.println("Choose what you want:");
int c = i.nextInt();
System.out.println("");
switch(c){
case 1:
p.adduser();
case 2:
p.update();
}
}
}