2 — Warmup: Defining and Working With Data
Due Thursday, 18 January 2024, 11:59:59pm
Background Northeastern has received funding to create an animal shelter and supporting veterinary clinic, to be known as the Husky Animal Lovers Park (HALP). The university would like to understand the administrative and personnel demands of running such a center, and have asked us to build a system that simulates how it may operate.
Our goal is to build a software system that can explore the potential behaviors and interactions at the center, as animal lovers visit and (hopefully) adopt pets, and manage the staff and appointments at the vet clinic.
Programming Task
The purpose of this milestone is to familiarize yourself with your tools and import configuration information for the center. The configuration will describe the animals currently at the shelter as well as the schedule of vets at the clinic. To ensure that the configuration is imported succesfully, we will compute some basic analytics.
The configuration will take the form of a JSON object of the following format:
{ |
"animals" : [Animal ...], |
"clinicians" : [VetSpec ...] |
} |
|
{ |
"name" : String, |
"age" : NaturalNumber, |
"type" : PetType, |
"beenVaccinated" : Bool, |
"picture" : UrlString |
} |
|
INTERPRETATION: The "age" is the number of months since the animal's |
birth. |
|
A UrlString is a String holding a valid URL. |
|
|
{ |
"name" : String, |
"specialties" : [String ...], |
"schedule" : [Day ...] |
} |
|
INTERPRETATION: Some of the vets may have specialty areas, such as "Internal |
Medicine" or "Toxicology". The "schedule" field contains each |
Day that the named vet works in the clinic. |
|
- "M" |
- "Tu" |
- "W" |
- "Th" |
- "F" |
- "Sa" |
- "Su" |
Your first task is to design a data representation for this information. Next, implement a method that parses raw, textual JSON information into your data representation. You are encouraged to use an existing library, such as gson, for this purpose.
The name of the oldest dog. Ties should be broken using lexicographical order on names
The name of the oldest cat. Ties should be broken using lexicographical order on names
The day of the week with the most working vets. Ties should be decided in favor of earlier days of the week (starting with Monday).
Finally, create an executable that accepts one command-line argument: the name of a file containing the JSON Configuration. The executable should compute and output the properties above in the following format:
{ |
"seniors" : [StringOrNull, StringOrNull], |
"availabilty" : Day |
} |
|
INTERPRETATION: the first element of the "seniors" field is the name |
of the oldest dog and the second is the name of the oldest cat. In the event |
that no such animal exists, the value should be null. |
|