-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
61 lines (49 loc) · 1.93 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
53
54
55
56
57
58
59
60
61
package Class;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("1");//此处需要系统说明
System.out.println("2");//此处需要选项说明
String chose=scan.next();
option:while (true)
{
switch (chose)
{
//此处需要选项
case "5"->{
System.out.println("exit");
break option;//用标识符跳出while循环 也可以是System.exit()
}
default -> System.out.println("Do not have this option");
}
}
}
public void cancelEvent(Event event) {
}
public void createEvent(int EventID,String name, String Data, String Location,String Organizer) {
Scanner scan = new Scanner(System.in);
Event event = new Event();
event.setID(scan.nextInt());
event.setDate(scan.nextLine());
event.setName(scan.nextLine());
event.setLocation(scan.nextLine());
event.setOrganizer(scan.nextLine());
System.out.println("Please input the information of organizer");
Organizer organizer=new Organizer();
organizer.setID(scan.nextInt());
organizer.setName(scan.nextLine());
organizer.setEmail(scan.nextLine());
//为完工方法 如何自由的将organizer(不是event中的organizer数组而是organizer对象)与event连接
}
public void viewRegisteredAttendees(Event event) {
//获取Event中装Attendee的集合
ArrayList<Attendee> Attendee = event.getAttendee();
//遍历集合
for (int i = 0; i < Attendee.size(); i++) {
Attendee attendee = Attendee.get(i);
System.out.println(attendee.getName() + "\t" + attendee.getEmail() + "\t" + attendee.getID());
}
}
}