Question: Student Class Problem Create a C + + program implementing a Car class. The class has attributes for miles, year, make, and model, along with
Student Class
Problem
Create a C program implementing a Car class. The class has attributes for miles, year, make, and model, along with external functions to change the car's color, update miles, and print information.
Attributes:
Define the Car class with the following attributes:
an integer representing the car's mileage.
year: an integer representing the car's manufacturing year.
a string representing the car's brand eg Toyota, Honda
model : a string representing the car's model eg Camry, Civic
a string representing the car's color.
Define a constructor that receives the following parameters.
int caryear, string carmake, string carmodel, string carcolor, int carmiles.
Implement the following external functions:
Student Class
Implement the following external functions:
changecolorCar& car, string newcolor : Updates the car's color.
updatemilesCar& car, int additionalmiles: Adds additional miles to the car's mileage. Make sure that if the input is a negative value it wont update the mileage.
change model Car& car, string new model: Updates the car's model.
Example output:
Car Information:
Year:
Make: Toyota
Model: Camry
Color: Blue
Miles:
Car Information:
Year:
Make: Nissan
Model: Rogue
Color: Gray
Miles:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
