Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .idea/copilot.data.migration.ask2agent.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 74 additions & 0 deletions src/main/java/org/codedifferently/GlennAppointment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package org.codedifferently;

public class GlennAppointment {
private String timeSlot;
private GlennPatient patient;
private boolean completed;
private boolean cancelled;

//Constructor
public GlennAppointment(String timeSlot, GlennPatient patient) {
this.timeSlot = timeSlot;
this.patient = patient;
this.completed = false;
this.cancelled = false;
}


//Getters
public GlennPatient getPatient() {
return patient;
}

public boolean isCompleted() {
return completed;
}

public boolean isCancelled() {
return cancelled;
}

//Setter
public void setTimeSlot(String timeSlot) {
if (timeSlot != null && !timeSlot.trim().isEmpty()) {
this.timeSlot = timeSlot;
} else {
System.out.println("Invalid Time");
}
}



//Method
public void complete() {
if (cancelled) {
System.out.println("Appointment was cancelled");
return;
}
if (completed) {
System.out.println("Appointment was already completed");
return;
}
completed = true;
System.out.println("Appointment was check as completed");
}

public void cancel() {
if (completed) {
System.out.println("Can't cancel completed appointment");
return;
}
if (cancelled) {
System.out.println("Appointment already canceled");
return;
}
cancelled = true;
System.out.println("Appointment already canceled");
}

public String toString() {
return timeSlot + "|" + patient.getName() + " | Completed: " + completed + " | Canceled: " + cancelled;
}


}
84 changes: 84 additions & 0 deletions src/main/java/org/codedifferently/GlennClinicApp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package org.codedifferently;
import java.util.Scanner;

public class GlennClinicApp{
public static void main(String[] args) {


theClinic();

}

//The Method That Directs the user to all the methods in the System class
public static void theClinic() {
Scanner scan = new Scanner(System.in);
GlennClinicSystem system = new GlennClinicSystem();


do {
System.out.println("Welcome to Derwin & Glenn's Geek Squad");
System.out.println("""
1. Add New Customer
2. View All Customers
3. Check In Customers
4. Search for Customers
5. Schedule Appointment
6. Cancel Appointment
7. Complete Appointment
8. View Daily Schedule
9. Daily Report
10. Exit""");
int choice = scan.nextInt();

switch (choice) {
case 1:
System.out.println("Enter Customer's Name: ");
String patientName = scan.next();

system.addPatient(patientName);
break;

case 2:
System.out.println("Customer LIST");
system.patientList();
break;
case 3:
system.checkPatientIn();

break;
case 4:
system.searchPatient();
break;
case 5:
system.schedulePatient();
break;
case 6:
system.cancelAppointment();
break;
case 7:
system.completeAppointment();
case 8:
system.dailySchedule();
break;
case 9:
system.dailyReport();
break;
case 10:
System.out.println("Goodbye, Thanks For Coming!");
System.exit(0);
break;
default:
System.out.println("Invalid Option");
break;


}
}while(true);





}
}

Loading