One way to measure the amount of energy that is expended during
exercise is to use metabolic equivalents (MET). Here are some METS
for various activities: Running 6 MPH: 10 METS
Basketball: 8 METS
Sleeping: 1 MET
The number of calories burned per minute may be estimated using the
Write a program that calculates and outputs the total number of
calories burned for a 150-pound person who runs 6 MPH for 30 minutes,
plays basketball for 30 minutes, and then sleeps for 6 hours. One
kilogram is equal to 2.2 pounds.
public class CaloriesCalculator
public static final double KILOGRAMS_PER_POUND = 2.2;
public static final int RUNNING_METS = 10;
public static final int BASKETBALL_METS = 8;
public static final int SLEEPING_METS = 1;
public static void main(String args)
double weightInKilograms = 150 / KILOGRAMS_PER_POUND;
double runningTimeInMinutes = 30;
double basketballTimeInMinutes = 30;
double sleepintTimeInMinutes = 6 * 60;
double caloriesBurnedForRunning = 0.0175
* RUNNING_METS * weightInKilograms
double caloriesBurnedForBasketball = 0.0175
* BASKETBALL_METS * weightInKilograms
double caloriesBurnedForSleeping = 0.0175
* SLEEPING_METS * weightInKilograms
double totalCaloriesBurned = caloriesBurnedForRunning
"Number of calories burned for running: "
"Number of calories burned for basketball: "
"Number of calories burned for sleeping: "
"\nTotal number of calories burned per minute: "
Number of calories burned for running: 357.95454545454544
Number of calories burned for basketball: 286.3636363636364
Number of calories burned for sleeping: 429.5454545454545
Total number of calories burned per minute: 1073.8636363636363