Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Project 6: Cats in Tree. 2 Project 3: Cats in Tree In this project you will Create a class definition for a Cat class. Populate a BST with Cat information.

Similar presentations


Presentation on theme: "1 Project 6: Cats in Tree. 2 Project 3: Cats in Tree In this project you will Create a class definition for a Cat class. Populate a BST with Cat information."— Presentation transcript:

1 1 Project 6: Cats in Tree

2 2 Project 3: Cats in Tree In this project you will Create a class definition for a Cat class. Populate a BST with Cat information from a file. Display the tree in a vertical orientation. Respond to user queries about cats in the tree. Start with most recent version of the BST template.

3 3 Class Cat For the purposes of this program, a cat has: Name Date of birth (mm/dd/yyyy) Weight in pounds There is a sample input file in the Downloads area: cats.txt Your program should work with any number of cats in the file.

4 4 Sample Input File

5 5 Class Date The cat's date of birth should be a Date object. Not a string. Define a Date class with just day, month, and year, as integers. Instantiate Date object with values read from the file.

6 6 Class Cat The << operator for class Cat should output only the cat's name. That's what we want to see in the tree display. Provide a display method that shows all information for the cat. Use that in responding to queries. Provide < and == operators based on the cat's name.

7 7 Modify display_v Modify the BST display_v method to permit the caller to specify the width of the columns in the output. When you call display_v from main, set the column width to the length of the longest name seen in the input file.

8 8 Program Flow Your program should Instantiate BST Read the input file. Instantiate a Cat object with each cat record in the file. Populate the BST with Cat objects from the file. Display the tree in a vertical format. Respond to queries about cats. See sample run.

9 9 Program Running

10 10 Development Environment You may develop your program on any system you like. But you should test the finished program on Circe. The same source files should compile and run on either Windows or Linux.

11 11 Ground Rules You may work with one other person. OK to work alone if you prefer. If you do work as a pair Work together! Both members are expected to contribute. Both members should understand the program in detail. Submit a single program. Do not share your code with other students. Before or after submitting the project. OK to discuss the project. Do not copy any other student’s work. Don’t look at anyone else’s program. Don’t let anyone look at your program.

12 12 Ground Rules Except for code posted on the class web site Do not copy code from the Internet or any other source. Write your own code.

13 13 Submission Project is due by 11:59 PM, Sunday night, March 27 Deliverables: Source files in zipped folder genBST3.h Date.h,.cpp Cat.h,.cpp main.cpp OK to zip entire Visual Studio project folder. If you work with another student, include both names in the assignment comments. Other student submit just a Blackboard submission comment including both names. End of Presentation


Download ppt "1 Project 6: Cats in Tree. 2 Project 3: Cats in Tree In this project you will Create a class definition for a Cat class. Populate a BST with Cat information."

Similar presentations


Ads by Google