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
  • Create a Python program that asks the user how many miles they think they may run....

    Create a Python program that asks the user how many miles they think they may run. The program should also ask them how much they weight. The program should then use a loop to calculate and print the number of calories burnt while running each mile. o Assume that a person burns 1 calorie per pound during each mile of running

  • please help part one) Calories Burned Running on a particular-treadmill you burn 3.9 calories per minute....

    please help part one) Calories Burned Running on a particular-treadmill you burn 3.9 calories per minute. Design a pro- gram that uses a loop to display the number of calories burned after 10, 15, 20, 25, and 30 minutes. 3 part two) Sum of Numbers Design a program with a loop that asks the user to enter a series of positive num bers. The user should enter a negative number to signal the end of the series. After all the...

  • Running on a particular treadmill you burn 3.4 calories per minute. Write a program that uses...

    Running on a particular treadmill you burn 3.4 calories per minute. Write a program that uses a loop to display the number of calories burned after 5, 10, 15, 20, 25, 30 and 35 minutes. C++

  • Running on a particular treadmill, you burn 4 calories per minute. Write an 80x86 assembly program...

    Running on a particular treadmill, you burn 4 calories per minute. Write an 80x86 assembly program that uses a loop to display the number of calories burned after 5, 10, 15, 20, 25, and 30 minutes. PLEASE WRITE an 8086 ASSEMBLY program!

  • Running on a particular treadmill you burn 3.9 calories per minute. Write a program that uses...

    Running on a particular treadmill you burn 3.9 calories per minute. Write a program that uses a loop to display the number of calories burned after 10, 15, 20, 25, and 30 minutes. Must be in VBA using option explicit

  • In C++ Write a program that calculates the occupancy rate for a hotel. The program should...

    In C++ Write a program that calculates the occupancy rate for a hotel. The program should start by asking the user how many floors the hotel has. A loop should then iterate once for each floor. In each iteration, the loop should ask the user for the number of rooms on the floor and how many of them are occupied. After all iterations, the program should display how many room the hotel has, how many of them are occupied, how...

  • Speeding Violation Calculator: Design a program that calculates and displays the number of miles per hour...

    Speeding Violation Calculator: Design a program that calculates and displays the number of miles per hour over the speed limit that a speeding driver was doing. The program should ask for the speed limit and the driver’s speed. Validate the input as follows: The speed limit should be at least 20 but not greater than 70. The driver’s speed should be at least the value entered for the speed limit (otherwise the driver was not speeding).Once correct data has been...

  • Hello. I want to write a function in C program to track calories for specified fitness...

    Hello. I want to write a function in C program to track calories for specified fitness activities i.e. run, walk, bike etc. I am trying to make an array with the activities and return calories burned per minute for each workout. The function will keep running until user tells it to stop. "maybe 'while' loop (Y/N)" or something like that. The main function will call the activity function and a few printf/scanf. My code looks pretty bad so if you...

  • Hello. I want to write a function in C program to track calories for specified fitness activities...

    Hello. I want to write a function in C program to track calories for specified fitness activities i.e. run, walk, bike etc. I am trying to make an array with the activities and return calories burned per minute for each workout. The function will keep running until user tells it to stop. "maybe 'while' loop (Y/N)" or something like that. The main function will call the activity function and a few printf/scanf. My code looks pretty bad so if you...

  • In Java. Use the concept of LOOPS: 2.Write a program that calculates the amount a person...

    In Java. Use the concept of LOOPS: 2.Write a program that calculates the amount a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day, and continues to double each day. The program should display a table showing the salary for each day, and then show the total pay at the end of the period. The output should be displayed in a dollar amount, not the...

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