In the spirit of the Tour de France, you have been asked to provide a program that calculates the speed of the 3 cycles based on its gears and compares the speed to an overall desired speed to determine which cycle to use:
a. Be able to handle up to 3 different cycles (Use can enter less than 3)
b. Enter the number of teeth for the main gear for each of the cycles (3 inputs)
c. Enter the revolutions per minute that the rider will pedal (3 inputs)
d. Enter the desired speed. (1 input)
e. Calculate the speed of each cycle
Formula 1: Speed of cycle = (RPMs * Number of Teeth) / 10
f. Calculate the Average Speed of the cycles
Formula 2: SUM of Formula 1 / (the number of cycles entered)
g. Determine which cycle is closest to the desired speed without being below:
h. Display all information
Test Case and Output Format:
Bike: RPMs Teeth Speed (Calculated)
Schwinn 80 8 64
Trek 100 6 60
K2 70 12 84
Desired Speed: 61
Average Speed: 69.33
Closest cycle: Schwinn
Solution Criteria:
1. Solution should use arrays for data
2. Solution should use looping to process algorithms