ECS 36B Spring 2023 Homework #6 (5%)
This is a group project involving two students.
For homework 3 and 4, you have been asked to design C++ classes to accomplish the following –
The ecs36b lecture on Wednesday, April 12 of 2023 ended at 6 pm in the room 176 of Everson Hall at UC Davis. The instructor took the Unitrans L line from the Silo Station, leaving at 6:10 pm, and the bus driver was a Psychology student named Tiffany. On the same bus, there was another ecs36b student, John. John asked the instructor some questions about homework assignment #2 (using his own computer), before he got off the bus at the 8th and J Street stop at 6:20 pm on the same date. After John being off the bus, the instructor started playing an online game on an Android device. The instructor said “thank you” to the bus driver, Tiffany, before he himself got off at the Moore and Pollock stop at 6:32 pm.
You designed and implemented classes such as Person, Thing (e.g., bus, computer, device, ), GPS (i.e., locations for classroom and the bus stops), Time (e.g., JvTime), and particular Record (when, where, who, and which things) to cover four events --
- Class room at 6:00 pm
- Silo station at 6:10 pm
- 8th and J Street at 6:20 pm
- Moore and Pollock at 6:32 pm
And, for each of the classes, you have implemented two virtual functions –
virtual Json::Value
- Missing any essential key-value pairs in the input JSON, for example, a GPS location JSON doesn’t have the latitude component of the DD format. [Message – “Missing
”] - The value type is unexpected/mismatched, for example, the value of the “latitude” key is not a Double or Float, instead, it is encoded as a String. [Message – “
must be ”] - The structure of the input JSON is incorrect. For example, we are expecting a JSON object but it is an Array or any non-object type. This might include anything not generated by your own dump2JSON() function. [Message – “Input JSON is not an Array”]
- Very unusual events are detected (this is a new part). We now require you to add a new attribute “hidden”, a String. If the JSON2Object function detects the “hidden” key-value pair AND the String is equal to “SOS” or “HELP”, then, your program will throw an exception as well. [Message – “A Critical Hidden detected”]
Furthermore, you will need to write a test program called ecs36b_hw6_driver.cpp, which will provide the corresponding try and catch clauses such that all four conditions can be tested/demonstrated.
For submission via canvas, please follow the steps:
• Create a subdirectory ecs36b_s2023, and then cd ecs36b_s2023. (mkdir, cd)
• Create a subdirectory hw4, and then cd hw6.
• Put all your programs and Makefile under the hw6 directory.
• You should also provide a README file to explain how to run your program.
• cd ..
• tar zcvf ecs36b_s2023_hw6submission
Grading policy – If your program makes and compiles okay, 1%. 1% for each of the four conditions, both the generation of throw and the design of catch those throws.