Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

pls must follow the instruction Keep all related contents of the unit together 1. C++ Source code in text 2. Validation Test run result text

pls must follow the instruction image text in transcribed
image text in transcribed
image text in transcribed
Keep all related contents of the unit together 1. C++ Source code in text 2. Validation Test run result text output (legible font >= 10 points) Test Run Driver 1) If a test driver (main) is provided for an assignment use it. 2) If the test driver is not provided, follow the sample test run example and implement your own test driver that perform the same User Interface U/l in the same form and format. Implement the test driver according to what the test run example. 2.1 In some rare class, the example does use hard coded (built-in) test data, only for the real basic ones. 2.2 Majority of the assignments, the test run example does have an U/l query for user to enter test data, *Check out the Submission Standard reference especially on the Validation Test Run. n Lab 2A Overloading Constructor Default, Copy and Argument Constructors . testCar.cpp and Carch Write a class named Car that has the following member variables: year Model. An int that holds the cars year model. make. A string that holds the make of the car. speed. An int that holds the cars current speed. In addition, the class should have the following constructor and other member functions. Constructor. The constructor should accept the cars year model and make as arguments. These values should be assigned to the object setYear Model and make member variables. The constructor should also assign 0 to the speed member variables. Accessor. Appropriate accessor functions e to get the values stored in an object setYear Model, make, and speed member variables. accelerate. The accelerate function should add 5 to the speed member variable each time it is called. brake. The brake function should subtract 5 from the speed member variable each time it is called Demonstrate the class in a program that creates a Car object, and then calls the accelerate function ve times. After each call to the accelerate function, get the current speed of the car and display it. Then, call the brake function five times. After each call to the brake function, get the current speed of the car and display it. . Sample Test Run: Uvestony\Downloads\Week02/caree Lurrent speed accelerating... urrent speedi 5 ccelerating... Burrent opeedi 18 Recelerating... Darrent opeedi 15 Bocelerating... Current speed: 20 Accelerating... Current speedi 25 Braking. Current speed: 20 Braking... Current speed: 15 Braking... Darrent opeed: 10 waking... Current speed: 5 Braking... Current speed: 8 Proceso returned execution time : 8.1993 Press any key to continue. Submit testCar.cpp Carh Validation Test Run Result reference source testCar.cpp: int main) { car (2001, "badass", 0); for(int i=0;i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Question 43 of 45 10

Answered: 1 week ago

Question

4. Who should be invited to attend?

Answered: 1 week ago

Question

7. How will you encourage her to report back on the findings?

Answered: 1 week ago