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:10
Water at 70°f and streams enter the mixing chamber at the same mass flow rate, determine the temperature and the quality of the exiting stream. 0 psia is heated in a chamber by mixing it with saturated water vapor at 20 psia. if both streams enters the mixing chamber at the same mass flow rate, determine the temperature and the quality of the existing system.
Answers: 2
question
Engineering, 04.07.2019 18:10
Machinery that is a key part of the process and without which the plant or process cannot function is classifed as: (clo4) a)-critical machinery b)-essential machinery c)-general purpose machinery d)-none of the specified options.
Answers: 1
question
Engineering, 04.07.2019 18:10
Aturning operation is performed with following conditions: rake angle of 12°, a feed of 0.35 mm/rev, and a depth of cut of 1.1 mm. the work piece is aluminum alloy 6061 with t6 heat treatment (a16061-t6). the resultant chip thickness was measured to be 1.0 mm. estimate the cutting force, fc. use shear stress of 207 mpa and coefficient of friction on the tool face of 0.6.
Answers: 1
question
Engineering, 04.07.2019 19:20
Air at a pressure of 1atm and a temperature of 40 c is in parallel flow over the top surface of a flat plate that is heated to a uniform temperature of 120 c. the plate has a length of 0.40m (in the flow direction) and a width of 0.15m. the reynolds number based on the plate length is 50, 000. what is the rate of heat transfer from the plate to the air? if the free stream velocity of the air is doubled and the pressure is increased to 10 atm what is the rate of heat transfer?
Answers: 2
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
History, 19.01.2021 20:00
question
Mathematics, 19.01.2021 20:00
question
Computers and Technology, 19.01.2021 20:00
question
Mathematics, 19.01.2021 20:00
question
Arts, 19.01.2021 20:00
question
History, 19.01.2021 20:00
question
Mathematics, 19.01.2021 20:00
question
Mathematics, 19.01.2021 20:00
question
Mathematics, 19.01.2021 20:00
Questions on the website: 13722363