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
Adouble-strand no. 60 roller chain is used to transmit power between a 13-tooth driving sprocket rotating at 300 rev/min and a 52-tooth driven sprocket. a) what is the allowable horsepower of this drive? b) estimate the center-to-center distance if the chain length is 82 pitches. c) estimate the torque and bending force on the driving shaft by the chain if the actual horsepower transmitted is 30 percent less than the corrected (allowable) power.
Answers: 3
question
Engineering, 04.07.2019 18:10
Hydraulic fluid with a sg. of 0.78 is flowing through a 1.5 in. i.d. pipe at 58 gal/min. the fluid has an absolute viscosity of 11.8 x 105 lbf-sec/ft2. is the flow laminar, turbulent or within the critical range? give both a numerical reynolds number and a term answer.
Answers: 3
question
Engineering, 04.07.2019 18:20
Asimple rankine cycle uses water as the working fluid. the water enters the turbine at 10 mpa and 480c while the condenser operates at 6 kpa. if the turbine has an isentropic efficiency of 80 percent while the pump has an isentropic efficiency of 70 percent determine the thermal efficiency
Answers: 1
question
Engineering, 04.07.2019 18:20
Find the minimum film thickness for a journal bearing with the data below. shaft diameter, d-50 mm, clearance ratio, cdratio? 0.001, shaft speed, n 2000 rpm; bearing length. i 200 mm; eccentricity ration, ? -0.55. ( note, cdratio-ca/d) the minimum film thickness is um
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
Mathematics, 28.01.2020 11:31
Questions on the website: 13722362