-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathGymSystem.java
More file actions
31 lines (23 loc) · 795 Bytes
/
GymSystem.java
File metadata and controls
31 lines (23 loc) · 795 Bytes
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
package org.codedifferently;
public class GymSystem {
private int memberCount = 0;
private int guestCount = 0;
private int completedAppointments = 0;
private final String gymName = "H2J GYM";
public void recordVisit(boolean isMember) {
if (isMember) memberCount++;
else guestCount++;
}
public void appointmentCompleted() {
completedAppointments++;
}
public void dailySummary() {
System.out.println("\n-- Daily Summary for " + gymName + " --");
System.out.println("Members visited: " + memberCount);
System.out.println("Guests visited: " + guestCount);
System.out.println("Appointments completed: " + completedAppointments);
}
public String getGymName() {
return gymName;
}
}