Write a C++ program name: Horse Race Write a program that runs a random horse race. The
Question:
Write a C++ program name: Horse Race
Write a program that runs a random horse race. The specification: There are three horses. During each round, a random number from 1 to 100 is generated for each horse. The horse advances one length if the random number is greater than 50. My track is 15 lengths long. Show the track this way:
1|--------H------| 2|-------H-------| 3|------------H--|
Write a function ShowHorse() that takes a horse number (1 to 3) and a position on the track, and shows the current position of the horse. Have the program run until one of the horses reaches the finish line.
If you don't want the previous track to appear on the screen you can use: system("clear") to clear the screen but you will need to add the following include statement:
#include
#include
You can end a program at anytime using the code: return 0
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill