Question: (C++ , do not use stdio.h) Write a class named Car that has the following member variables: Year: An int that holds the car's model

(C++ , do not use stdio.h)

 (C++ , do not use stdio.h) Write a class named Car

Write a class named Car that has the following member variables: Year: An int that holds the car's model year Make: a string that holds the make of the car Speed. An int that holds the car's current speed The class should also has the following member functions Constructor. The constructor should accept the car's year and make as arguments and assign these values to the object's year and make member variables. The con-structure should initialize the speed member variable to 0. Accessor: Appropriate accessor functions should be created to allow values to be retrieved from an object's year, make, and speed member variables. * Demonstrate the class in a program that creates a Car object

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!