-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConsole_Appointment.java
More file actions
58 lines (48 loc) · 1.85 KB
/
Console_Appointment.java
File metadata and controls
58 lines (48 loc) · 1.85 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
import java.util.Scanner;
public class Console_Appointment {
static String allAppointnemts="";
static Scanner scan = new Scanner(System.in);
public static void main(String[]args){
int option;
do{
System.out.println("[1] Add Appointment\n[2] View All Appointments\n[3] Exit\nEnter Option\n");
option = scan.nextInt();
switch (option) {
case 1:
addAppointment();
break;
case 2:
viewAllAppointments();
break;
default:
break;
}
}while(option!=3);
}
public static void addAppointment(){
System.out.println("Add Appointment");
System.out.println("Enter Appoinment ID");
int id = scan.nextInt();
System.out.println("Enter Date");
String date = scan.next();
System.out.println("Enter Time");
String time = scan.next();
System.out.println("Purpose");
String purpose = scan.next();
System.out.println("Enter Status");
String status = scan.next();
allAppointnemts+= "\n" +
"Appointment ID: " + id +"\n"+
"Date: " + date +"\n"+
"Time: " + time +"\n"+
"Purpose: " + purpose +"\n"+
"Status: " + status +"\n"+
"-----------------------------";
}
public static void viewAllAppointments(){
System.out.println(
"===APPOINTMENTS==="+"\n"+
allAppointnemts
);
}
}