Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Marathon problem You and your friends are preparing to run a Marathon. You are asked to calculate the distance of an athlete run in a

image text in transcribed
Marathon problem You and your friends are preparing to run a Marathon. You are asked to calculate the distance of an athlete run in a Marathon. The distance can be calculated as: Distance = Speed Time Write a program that asks the user (athlete) for the speed of his/her running pace (in miles-per-hour) and the number of hours the athlete is planning to run. Both values are assumed to be integers. For example, if the athlete fun 2 hours with a speed of 5mph (miles per hour), the distance run is 10 miles. Use a loop to display the distance an athlete run for each hour of a time period specified by the user. For example, if an athlete run for a four-hour time period with a speed of 5mph, it should display a report similar to the one that follows: Input Validation: Do not accept a negative number for speed and do not accept any value less than 1 for time traveled

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago