CIS247C Week 4 Project Overview
The objective this week is to enhance last week’s Vehicle class by creating another class to describe the warranty of a vehicle. The Warranty class includes information about the number of years and the number of miles the warranty is valid for.
In the Warranty class complete the following steps:
• Define the default constructor, multi-argument constructor, and destructor.
• As shown in the UML Class diagram, each attribute should have a “getter” to retrieve the stored attribute value, and a “setter” that modifies the value.
• The displayWarranty() method should display all the attributes of the Warranty object in a well-formatted string with logical labels applied to each attribute.
In the Vehicle class:
• Link the header file for the warranty class.
• Add the warranty class as a private attribute.
• Update the constructors to include the Warranty class as an attribute.
• Update the displayVehicle() method to display the Warranty class.
• Add the getWarranty() and setWarranty(Warranty &) methods.
In the main program:
Create code statements that perform the following operations. Note that several of the steps below were accomplished in last week’s assignment. New steps are in bold.
1. Using your code from Week 1, display a divider that contains the string “Start Program”.
2. Update and call the DisplayApplicationInformation function.
3. Using your code from Week 1, display a divider that contains the string “Vehicle 1”
4. Create a Vehicle object using the default constructor.
5. Prompt for and then set year and mpg using the overloaded setters from week 3 that accepts strings.
6. Create a Warranty object called warranty1 using the default constructor.
7. Prompt for and set number of years and number of miles. **Make sure to convert the return data type of the GetInput() function from a string to an integer**
Ex: warranty1.setMiles(atoi(GetInput(“number of miles”).c_str()));
8. Using your code from Week 1, display a divider that contains the string “Vehicle 2”
9. Create a Warranty object called warranty2 using the multi-argument constructor. You can set the number of year as 6 and number of miles as 70000.
10. Create another second Vehicle object using the multi-argument constructor, setting each of the attributes with the following values: “Cadillac”, 2017, 26.5 , warranty2
11. Display the Vehicle Information.
12. Create a third object by copying the second object.
13. Delete the third object by calling the destructor method.
14. Display the number of vehicles created using getNumVehicles. Remember to access getNumVehicles using the class name, not the Vehicle object.
15. Update and call the TerminateApplication function.
Compiles correctly 10
Warranty class 10
Warranty class implemented into Vehicle class 15
Prompt user for Warranty information 5
Correctly formatted output 5
1. Review instructions and UML diagram.
2. Create a new project and name it “CIS247_Project4”. Copy all the source files from the Week 3 project into the Week 4 project.
3. Compile and test the program to ensure there are no errors.
4. Capture screenshot of working code and paste into word document.
5. Submit zipped visual studio project and screenshot.
Refer to the following UML class diagram. No pseudocode is provided.