Knowee
Questions
Features
Study Tools

Develop a Java program to assist a user in managing their daily exerciseroutine. Allow the user to input the duration (in minutes) of exercisesperformed for morning, afternoon, and evening. Use control statements tocalculate the total exercise time throughout the day. Implement operators toperform arithmetic calculations to determine the total exercise time. Displaythe total exercise time to the user and provide feedback on whether they havemet or exceeded their daily exercise goal (e.g., 60 minutes). Utilizeappropriate data types, operators, and control statements to help users trackand manage their daily exercise routine effectively

Question

Develop a Java program to assist a user in managing their daily exerciseroutine. Allow the user to input the duration (in minutes) of exercisesperformed for morning, afternoon, and evening. Use control statements tocalculate the total exercise time throughout the day. Implement operators toperform arithmetic calculations to determine the total exercise time. Displaythe total exercise time to the user and provide feedback on whether they havemet or exceeded their daily exercise goal (e.g., 60 minutes). Utilizeappropriate data types, operators, and control statements to help users trackand manage their daily exercise routine effectively

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

Here is a simple Java program that meets your requirements:

import java.util.Scanner;

public class ExerciseRoutine {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.println("Enter morning exercise duration in minutes:");
        int morningExercise = scanner.nextInt();

        System.out.println("Enter afternoon exercise duration in minutes:");
        int afternoonExercise = scanner.nextInt();

        System.out.println("Enter evening exercise duration in minutes:");
        int eveningExercise = scanner.nextInt();

        int totalExercise = morningExercise + afternoonExercise + eveningExercise;

        System.out.println("Your total exercise time today is: " + totalExercise + " minutes.");

        if (totalExercise >= 60) {
            System.out.println("Congratulations! You have met or exceeded your daily exercise goal.");
        } else {
            System.out.println("You have not met your daily exercise goal. Keep going!");
        }
    }
}

This program first prompts the user to input the duration of their morning, afternoon, and evening exercises. It then calculates the total exercise time by adding up these three durations. The total exercise time is then displayed to the user. Finally, an if-else control statement is used to provide feedback to the user on whether they have met or exceeded their daily exercise goal of 60 minutes.

This problem has been solved

Similar Questions

Develop a Java program to assist a user in managing their daily calorieintake. Allow the user to input the calories consumed for breakfast, lunch,and dinner. Use control statements to calculate the total calories consumedthroughout the day. Implement operators to perform arithmetic calculationsto determine the total calories. Display the total calorie count to the userand provide feedback on whether they have exceeded or stayed within theirdaily calorie limit (e.g., 2000 calories). Utilize appropriate data types,operators, and control statements to help users track and manage their dailycalorie intake effectively.

Develop a Java program to help a user manage their daily water intake.Allow the user to input the amount of water consumed (in liters) for morning,afternoon, and evening. Use control statements to calculate the total waterconsumed throughout the day. Implement operators to perform arithmeticcalculations to determine the total water intake. Display the total water intaketo the user and provide feedback on whether they have met or exceeded therecommended daily water intake (e.g., 2.5 liters). Utilize appropriate datatypes, operators, and control statements to help users track and manage theirdaily water intake effectively.

What is the recommended duration of moderate to vigorous physical activities (MVPAs) for most days of the week?*1 pointA. 30 minutesB. 45 minutesC. 60 minutesD. 90 minutes

What is the first step in developing a personal fitness plan?Group of answer choicesset target time (duration) of exerciseset goalsselect activitiesset target intensity of exercise

Create a Time class and initialize it with hours and minutes.1. Make a method addTime which should take two time object and add them. E.g.- (2 hour and 50 min)+(1 hr and 20 min) is (4 hr and 10 min)2. Make a method displayTime which should print the time.3. Make a method DisplayMinute which should display the total minutes in the Time. E.g.- (1 hr 2 min) should display 62 minute.

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.