subject
Engineering, 22.02.2020 02:26 azzyla2003

Write a class named Car that has the following member variables: year : An int tht holds the cars model year. make : A string object that holds the make of the car speed : An int that holds the car's current speed. In addition, the class should have the following member functions. Constructor: The constructor should accept the car's year and make as assignments and assign these values to object's year and make member variables. The contructor should initialize the speed member variable to 0. Accessors: Appropriate accessor functions should be created to allow values to be retrieved from an object's year, 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 five times. After each call to the accelerate function, get the current speed of the car display it.

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:20
The characteristic roots of a dynamic system are: 1.7920 1.8160 i, -1.7920 1.8160 i, -0.4160 what is the order of this system? what are the settling time and damping ratio of the system?
Answers: 3
question
Engineering, 04.07.2019 19:20
Apure substance is a)-mixture of various chemical elements or compounds b)-substance that has a fixed chemical composition throughout c)-mixture that is homogeneous (such as air) d)-all the answers
Answers: 3
question
Engineering, 06.07.2019 03:20
Areaction-bonded silicon nitride ceramic has a strength of 250 mpa and a fracture toughness of 3.4 mpa(m)^1/2, what is the largest-sized internal flaw that this material can support without fracturing? (use y -1 in the fracture-toughness equation.)
Answers: 3
question
Engineering, 06.07.2019 03:20
Major ingredients of traditional ceramics (a) silica (b) clay (c) feldspar (d) all
Answers: 1
You know the right answer?
Write a class named Car that has the following member variables: year : An int tht holds the cars mo...
Questions
question
Biology, 10.10.2019 06:30