The user may enter a new doctor into the vet clinic. The user will input the name and specialisation.

computer science

Description

Specification 

The program will keep track of up to 2 doctors, and up to 4 pets. 

When run, the program will display a menu of actions to the user, including one that exits the program. Until the user chooses to exit, the menu is displayed again after each action is completed. The program must have the following functionalities: 


1 The user may enter a new doctor into the vet clinic. The user will input the name and specialisation. If a doctor with the same name already exists, or the specialisation is invalid, or the doctor limit has been reached, the program should output an error message. 


2 The user may enter a new pet into the vet clinic. The user will input the name, type, size, weight, and age. If a pet with the same name already exists, or an invalid value is given, or the pet limit has been reached, the program should output an error message. 


3 The user may delete a doctor from the vet clinic. The user will input the name of the doctor. If the doctor does not exist, the program should output an error message. Before deletion, all pets that are assigned to the specified doctor should have their 'doctor' instance variable updated to "No doctor assigned". 


4 The user may delete a pet from the vet clinic. The user will input the name of the pet. If the pet does not exist, the program should output an error message. 


5 The user may request a list of doctors in the vet clinic with all the information of each doctor. Normally, one line should be output for each doctor, with the form: Doctor : specialist. If there are no doctors, the program should output the message "No doctors". 


6 The user may request a list of pets in the vet clinic with all the information of each pet. Normally, one line should be output for each pet, with the form: Pet : weighing kg at years old (). If there are no pets, the program should output the message "No pets". 


7 The user may request a list of pets assigned to a specific doctor. The user will input the name of the doctor. Normally, one line should be output for each pet, similarly to above. If there are no doctors, the program should output "No doctors". If the named doctor does not exist, the program should output "No doctor with that name". Otherwise, if the doctor has no assigned pets, the program should output "No assigned pets". 


8 The user may assign a doctor to a pet. The user will input the name of the pet and the name of the doctor. If the pet or doctor do not exist, or the pet is already assigned to that doctor, or the doctor does not have the right specialisation, the program will output an error message. If the pet is already assigned to another doctor, the program should ask the user to confirm that they would like to change the assigned doctor. 

Instruction Files

Related Questions in computer science category