Vet Case Study

A veterinarian keeps a database of customers' dogs. Information is stored in the following format:


0712-0110-125dewardrive


The information starts with the dog's 4-digit ID number and then a dash.

Then there is a series of 4 ones and zeros.

  1. The first number indicates if the dog received a rabies injection by the vet within the last year, 1 means yes, 0 means no.
  2. The second number indicates if the dog received ringworm treatment by the vet within the last year, 1 means yes, 0 means no.
  3. The third number indicates if the dog received tick treatment by the vet within the last year, 1 means yes, 0 means no.
  4. The final number indicates if the dog is still on the vet's treatment list. 1 means yes, 0 means no.

Then there is another dash followed by the dog's address.

1

Write a program that will run as follows.

The list of dogs in the database is displayed. The vet is then prompted by the following options:

  • Press 0 to exit
  • Press 1 to view the full database of dogs.
  • Press 2 to view rabies treated dogs.
  • Press 3 to view ringworm treated dogs.
  • Press 4 to view tick treated dogs.
  • Press 5 to view dogs still on treatment list.
  • Press 6 to view dogs who have had all 3 treatments.
  • Press 7 to view dogs listed in ascending order of ID.
  • Press 8 to enter a new dog into the database.

After choosing an option, the data is processed and the menu option appears again, unless 0 is selected.

Make sure you validate the user entry. Only numbers in the range 0-8 are valid.

Make sure you validate any new dog info if the user selects 8 eg

123-1111-6EdgewareRoad will be rejected.

Your code should work for any list of dogs. Use any test data to test your program.

Your solution must be modular in design.

The dog database can be a data structure of your choice, or a file.