首页 > > 详细

代写ECS 36B Spring 2023 Homework #6

ECS 36B Spring 2023 Homework #6 (5%)


Due: May 30, 11:59 pm

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 --

1.Class room at 6:00 pm
2.Silo station at 6:10 pm
3.8th and J Street at 6:20 pm
4.Moore and Pollock at 6:32 pm

And, for each of the classes, you have implemented two virtual functions –
virtual Json::Value ::dump2JSON();
virtual bool ::JSON2Object(Json::Value);
For this assignment, you will enhance your design and implementation such that your JSON2Object virtual member function will “throw” ecs36b_exception objects if any of the following FOUR conditions is detected with an error message describing the condition –
1.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 ”]
2.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 ”]
3.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”]
4.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_hw6_submission_.tar.gz hw1
upload ecs36b_s2023_hw6_submission_.tar.gz to Canvas
ONLY one member of the team needs to submit with team name and both student IDs included in the README file.

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.

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!