Answer to Question #39934 in C++ for Verasak Sitawan

Question #39934
Use the Car and RaceCar classes you created in the You Do It section of this chapter, or
create them now. Make the following changes:
Write a main()function that declares a Car and a RaceCar. Set a constant distance
for the length of a race—for example, 500 miles. Assign numbers to the cars, start them,
and while they have not traveled more than the race distance, select a random number
under 200 to use to set the speed of both cars, and then increase the number of miles
each car has traveled. (Because the Car and RaceCar have different maximum speeds,
during some hours they will travel at different speeds. Appendix E contains instructions
on producing random numbers.) After one of the cars exceeds the race distance, display
the winner. Save the file as Race.cpp.
e. Alter the main()function so that different random speeds are used for each car. Save
the file as Race2.cpp.
f. Alter the main()function so that both cars are RaceCars. Save the file as Race3.cpp.
Expert's answer
Dear customer,
Unfortunately, your question requires a lot of work and cannot be done for free.
Please submit it with all requirements as an assignment to our control panel and
we'll assist you.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be the first!

Leave a comment

Ask Your question

New on Blog