Hello,
I would like to write a program to calculate how many laps a runner can make for 45 minutes with 10% increase of his or her running time in each lap.
The runner run the first lap in 1 minute.
Here is what I have.
lapcounter=1;running_time=1;runningtime_total=0;runningtime_allowed=45;number_lap=0;while lapcounter<=runningtime_allowed lapcounter=lapcounter+(lapcounter*0.10); running_time=lapcounter+(lapcounter*0.10); runningtime_total=running_time+(running_time*0.10); disp("Time: " + runningtime_total); number_lap=number_lap+1;enddisp("Number of lap: " + number_lap);
I think I get the idea of how to calculate running time in each lap like running time = lap time*(lap time*0.10), but I need to add the time the runner has been running so that I can know how many laps he or she can make for 45 minutes.
I appreciate your response in advance.
Best Answer