Question: import java.util.Scanner; / * * * UI file for console based running of this system. * / public class ScheduleSystem { private static Scanner input
import java.util.Scanner;
UI file for console based running of this system.
public class ScheduleSystem
private static Scanner input new ScannerSystemin;
private static VetDB db;
private static String date;
private static Queue room new Queue;
private static Queue room new Queue;
private static Queue room new Queue;
main method
@param args command line arguments
public static void mainString args
System.out.println Vet Schedule System ;
date getDatePlease enter today's dateMMDDYYYY: ;
set up date file.
db new VetDBdate txt;
dbreadDaySchedule;
dbreadPastVisits;
dbreadPets; this needs to be last for the past visits to appear in the pets
int choice ;
while choice
System.out.println Main Menu ;
System.out.println View Today's Visits";
System.out.println Add Visit";
System.out.println Assign Next Visit to Room";
System.out.println Complete Visit";
System.out.println Search Pet";
System.out.println Add Pet";
System.out.println Exit";
choice getIntOperation: ;
System.out.println;
switch choice
case viewToday;
case addVisit;
case assignVisitToRoom;
case completeVisit;
case searchPet;
case addPet;
case exitSystem;
System.out.println;
YOUR TODO
This method will loop through and print out the daily schedule from the DB object.
You should print as the following format:
Animal ID animal basic ID
animalVisitString from the visit extra new line
private static void viewToday
System.out.println Today's Schedule ;
This method will get information on a new visit to add into the system.
private static void addVisit
System.out.println Add a Visit ;
String vDate getDateEnter dateMMDDYYYY: ;
System.out.printEnter time: ;
String time input.nextLine;
int animalID getIntEnter animal ID: ;
check if ID matches a valid pet in system
while dbgetPetanimalID null
System.out.printlnNo animal with that ID;
animalID getIntEnter animal ID: ;
System.out.printEnter details of visit: ;
String details input.nextLine;
Visit v new VisitdbgetNextVisitID vDate, time, animalID, details;
if dbaddVisitv
System.out.printlnVisit added.";
else
System.out.printlnError adding visit. No open time slot or open day. Try Again.";
YOUR TODO
This method assigns the next visit in the daily schedule queue to the next available room.
You should use room room and room as queues for the rooms and if they are empty add the next
Visit from the db object. Note there is a getNextVisit method on the DB object that dequeues and
sends it to you to enqueue onto the room
private static void assignVisitToRoom
This method will have you choose which room to "complete" the visit
Then add extra notes to the Visit and put on the completed stack
for the DB and on the Pet the visit was for.
private static void completeVisit
Visit current null;
while current null
System.out.println Complete Pet Visit ;
System.out.printlnRoom ;
System.out.printlnRoom ;
System.out.printlnRoom ;
System.out.println to Cancel";
int choice getIntRoom: ;
if choice
return; don't do anymore checking.
if choice && roomisEmpty
current roomdequeue;
else if choice && roomisEmpty
current roomdequeue;
else if choice && roomisEmpty
current roomdequeue;
else
System.out.printlnCant complete, no visit assigned to room.";
current should have a visit, add doc notes to it
System.out.print Completing Visit
current.animalVisitString
Enter doctor notes: ;
String notes input.nextLine;
current.addDetailsnotes;
add to the completed list on db
dbcompleteVisitcurrent;
Searches for a pet using the db
private static void searchPet
System.out.println Pet Search ;
int id getIntEnter pet ID: ;
Pet p dbgetPetid;
if p null
System.out.printlnPet not found.";
else
System.out.println Pet Found ;
System.out.printlnp;
Get info for a new pet and attempts to add to the DB
private static void addPet
System.out.println Add a Pet ;
int id getIntEnter animal ID: ;
System.out.printEnter pet name: ;
String petName input.nextLine;
System.out.printEnter pet type: ;
String petType input.nextLine;
System.out.printEnter pet subtype: ;
String petSubtype input.nextLine;
System.out.printEnter pet owner: ;
String petOwner input.nextLi
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
