Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

ECS 36B

Fall 2022

Homework #2 (8%)

Due: October 28, 11:59 pm (Little Red Riding Hood, part 1)

This is a group project involving exactly two students.

From https://americanliterature.com/childrens-stories/little-red-riding-hood

You will design and implement classes and objects to represent at least the RED part of the quoted story è

Once upon a time there was a dear little girl who was loved by every one who looked at her, but most of all by her grandmother, and there was nothing that she would not have given to the child. Once she gave her a little cap of red velvet, which suited her so well that she would never wear anything else. So she was always called Little Red Riding Hood.

One day her mother said to her, "Come, Little Red Riding Hood, here is a piece of cake and a bottle of wine. Take them to your grandmother, she is ill and weak, and they will do her good. Set out before it gets hot, and when you are going, walk nicely and quietly and do not run off the path, or you may fall and break the bottle, and then your grandmother will get nothing. And when you go into her room, don't forget to say, good-morning, and don't peep into every corner before you do it."

I will take great care, said Little Red Riding Hood to her mother, and gave her hand on it.

The grandmother lived out in the wood, half a league from the village, and just as Little Red Riding Hood entered the wood, a wolf met her. Little Red Riding Hood did not know what a wicked creature he was, and was not at all afraid of him.

"Good-day, Little Red Riding Hood," said he.

"Thank you kindly, wolf."

"Whither away so early, Little Red Riding Hood?"

"To my grandmother's."

"What have you got in your apron?"

"Cake and wine. Yesterday was baking-day, so poor sick grandmother is to have something good, to make her stronger."

"Where does your grandmother live, Little Red Riding Hood?"

"A good quarter of a league farther on in the wood. Her house stands under the three large oak-trees, the nut -trees are just below. You surely must know it," replied Little Red Riding Hood.

You should design and implement classes such as Person (BTW, let’s treat the wolf as a person), Thing (e.g., cap, wine, cake, ), GPS (i.e., location for homes, specific trees, or a particular spot “in the wood”), Time (e.g., JvTime), and particular Record (when, where, who, and which things).

Your test program will need to show the following FOUR records:

1. Little Red Ridding Hood wore the Cap

2. Her mom gave her the cake and wine

3. Little Red met the wolf at a particular spot in the wood

4. Grandma was at her own home right outside of the wood and there were three large oak trees nearby

Furthermore, for each of the classes, you need to implement the member function dump2JSON

Json::Value <class_name>::dump2JSON();

Therefore, the test program you have will need to first create four records as stated above, then call dump2JSON on all four records to show the results.

For submission via canvas, please follow the steps:

· Create a subdirectory ecs36b_f2022, and then cd ecs36b_f2022. (mkdir, cd)

· Create a subdirectory hw2, and then cd hw2.

· Put all your programs and Makefile under the hw2 directory.

· You should also provide a README file to explain how to run your program.

· cd ..

· tar zcvf ecs36b_f2022_hw2_submission_<your_student_id>.tar.gz hw1

· upload ecs36b_f2022_hw2_submission_<your_user_id>.tar.gz to Canvas

· every member of the team needs to submit (the exact same copy) with both student IDs included in the README file.