-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActivityApp.java
More file actions
64 lines (48 loc) · 1.66 KB
/
Copy pathActivityApp.java
File metadata and controls
64 lines (48 loc) · 1.66 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
import java.util.Scanner;
public class ActivityApp {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
Scanner num = new Scanner(System.in);
RoomActivity[] activity = new RoomActivity[50];
char organiser = ' ';
int lab30 =0;
for (int i = 0; i < activity.length; i++)
{
System.out.print("\n\nBOOKING NO."+ (i+1));
System.out.print("\n---------------");
System.out.println("\nActivity Name : ");
String activityName = sc.nextLine();
System.out.println("\nOrganiser ( Government // Private // University): ");
organiser = sc.next().charAt(0);
System.out.println("\nEnter Budget: ");
double budget = num.nextDouble();
sc.nextLine();
System.out.println("\nEnter Date (dd/mm/yyyy): ");
String date = sc.nextLine();
System.out.println("\nChoose Room Type (Auditorium // Meeting Room // Computer Lab // Seminar Room): ");
String roomType = sc.nextLine();
System.out.println("\nEnter Number of Participants: ");
int numOfParticipant = num.nextInt();
activity [i] = new RoomActivity(activityName, organiser, budget, date, roomType, numOfParticipant);
System.out.println(activity [i].toString());
if (roomType.equalsIgnoreCase("L") && numOfParticipant > 30)
{
lab30++;
}
sc.nextLine();
}
for(int i = 0; i<activity.length; i++){
if (organiser == 'P')
{
System.out.println(activity [i].toString());
}
if (activity[i].getRoomtype().equalsIgnoreCase("L") && activity[i].getParticipants() > 30)
{
System.out.println(activity[i].printer());
System.out.println("\nNumber of Computer Lab that has been use with 30+ participants :"+lab30);
}
}
sc.close();
num.close();
}
}