Question

Write a program that calculates the calories burned while running over a given number of miles....

Write a program that calculates the calories burned while running over a given number of miles. While several factors determine how many calories are burned during a mile run, for this program, 90 calories are burned for every mile of running. The cumulative calories burned during a run can be calculated as:

Calories * Distance

For example, if a person runs 5 miles, the total calories burned is 450. After 3 hours, the person has burned 2 calories.

The program should ask for the number of miles ran. It should use a loop to display the total calories burned after eachmile. For example, if the user ran 5 miles, the program should display a report similar to the following:

Miles run Calories Burned

1                                     90

2                                     180

3                                     270

4                                     360

5                                     450

Input Validation: Do not accept a value less than 1 or greater than 30

Note: You must use a loop to calculate the calories burned after each mile and generate a table similar to the one above to receive credit.

Submit your .java file in the Dropbox.

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
Write a program that calculates the calories burned while running over a given number of miles....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT