Question: I want the program as c++ code (can be written in code blocks ) Exercise # 5: Hero Run A hero can run very fast.
I want the program as c++ code (can be written in code blocks )
Exercise # 5: Hero Run A hero can run very fast. To start running, he needs to drink a bottle of orange juice. After drinking the first bottle he can run 10 km. To run more, he needs more juice. After the drinking the second bottle he can run 20 km, and after drinking the next bottle 30 km and so on. Sadly, he can never go more than 40 km after the fourth bottle. Input the total distance he needs to run and calculate how many bottles of orange juice our hero needs to cover that distance. Enter Total Distance: 80 After 1 bottle(s) at: 10 km After 2 bottle(s) at: 30 km After 3 bottle(s) at: 60 km After 4 bottle(s) at: 100 km Our hero needs 4 bottle(s) of orange juice. Enter Total Distance: 160 After 1 bottle(s) at: 10 km After 2 bottle(s) at: 30 km After 3 bottle(s) at: 60 km After 4 bottle(s) at: 1e0 km After 5 bottle(s) at: 140 km fter 6 bottle(s) at: 180 km ur hero needs 6 bottle(s) of orange juice
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
