CS 120 Project 4 solution


Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment


5/5 - (5 votes)

For this project you will design, implement, and test C++ class inheritance with components.
Design You will need to have at least three classes: the parent class, the child class, and the component class. The component can be included in either the parent or the child. Think about what each of the three classes will represent. What added methods does the child class have? What added fields does the child class have? Where does the component belong? Some examples: – A Saxophone class that extends Musical_Instrument and has a component Reed – A Sailboat class that extends Boat and has a component Sail – A Video_Game class that has component Console and child First_Person_Shooter – A HybridCar class that extends Car and has component Battery – A Trainer class that has component Pokemon and child Team_Rocket_Trainer
Implement Your classes should be declared in header file(s) (with RMEs and other comments) and defined in corresponding .cpp file(s). You may reuse classes from previous projects if appropriate.
Test To make sure your classes are working the way you designed, include a .cpp file that has the main function and tests your classes thoroughly.
Grading The project is out of 60 points. Design and Style 2 pts Are there at least three files and does each file have the correct code? 6 pts Are there sufficient comments and/or writings to explain what each method accomplishes and what each field represents? 4 pts Do the files follow the style guidelines from class? Are they readable? Do the names make sense? 8 pts Is there evidence of a well-thought-out design? Does each method have a clear purpose? Is this the best way to implement the class given the functionality goals? Implementation 12 pts Are there three classes: a parent class, a child class, and a component class? 6 pts Does the child add fields and add/override methods when appropriate? 6 pts Does the component class make sense in the context of the program? Testing 8 pts Is every method tested (directly or indirectly)? 8 pts Does testing cover all possible cases?
Extra Credit To earn extra credit, you must complete the following: 1. Create an enumerated type that fits in with your project 2. Include at least one field that is of the enumerated type in at least one of your three classes 3. Use the enumerated field in at least one method of the class. This could be making a calculation with it, printing something based on its value, etc. You can earn up to 10 points of extra credit for this, at the grader’s discretion. If you are going for the extra credit, make sure to include it in the Blackboard comments when you submit.