Answer: With the criteria you have listed, here's the code.
import java.util.Scanner;
public class CaloricExpenditure {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("Enter the number of hours spent bicycling: ");
int hoursBicycling = scan.nextInt();
System.out.print("Enter the number of hours spent jogging: ");
int hoursJogging = scan.nextInt();
System.out.print("Enter the number of hours spent swimming: ");
int hoursSwimming = scan.nextInt();
int totalCalories = (hoursBicycling * 200) + (hoursJogging * 475) + (hoursSwimming * 275);
double poundsLost = totalCalories / 3500.0;
System.out.println("You have burned a total of " + totalCalories + " calories.");
System.out.println("This means you have lost " + poundsLost + " pounds.");
}
}
Step-by-step explanation:
The Scanner class is used in this software to ask the user to enter how many hours they spent doing each activity. The total amount of calories burned is then determined by dividing the caloric expenditure of each activity by the quantity of time spent engaging in that activity. The total amount of calories burned is then divided by 3500 to determine the number of pounds lost. The user sees the outcome in the console.