In Java
The following equations estimate the calories burned when exercising (source):
Women: Calories = ( (Age x 0.074) — (Weight x 0.05741) + (Heart Rate x 0.4472) — 20.4022 ) x Time / 4.184
Men: Calories = ( (Age x 0.2017) + (Weight x 0.09036) + (Heart Rate x 0.6309) — 55.0969 ) x Time / 4.184
Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output calories burned for women and men.
Output each floating-point value with two digits after the
decimal point, which can be achieved as follows:
System.out.printf("%.2f", yourValue);
Ex: If the input is:
49 155 148 60
the output is:
Women: 580.94 calories Men: 891.47 calories
import java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner in = new Scanner(System.in); double age = in.nextDouble(); double weight = in.nextDouble(); double rate = in.nextDouble(); double time = in.nextDouble(); double women = (age * 0.074 - weight * 0.05741 + rate * 0.4472 - 20.4022) * time / 4.184; double men = (age * 0.2017 + weight * 0.09036 + rate * 0.6309 - 55.0969) * time / 4.184; System.out.printf("Women: %.2f calories\n", women); System.out.printf("Men: %.2f calories\n", men); } }
In Java The following equations estimate the calories burned when exercising (source): Women: Calories = (...
In C please!: The following equations estimate the calories burned when exercising (source): Men: Calories = ( (Age x 0.2017) — (Weight x 0.09036) + (Heart Rate x 0.6309) — 55.0969 ) x Time / 4.184 Women: Calories = ( (Age x 0.074) — (Weight x 0.05741) + (Heart Rate x 0.4472) — 20.4022 ) x Time / 4.184 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output calories burned...
2.18 LAB: Calories burned during workout (expressions) Programming Language : JAVA The following equations estimate the calories burned when exercising (source): Men: Calories = [(Age x 0.2017) — (Weight x 0.09036) + (Heart Rate x 0.6309) — 55.0969] x Time / 4.184 Women: Calories = [(Age x 0.074) — (Weight x 0.05741) + (Heart Rate x 0.4472) — 20.4022] x Time / 4.184 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes)....
2.24 LAB: Expression for calories burned during workout 2.24 LAB: Expression for calories burned during workout The following equations estimate the calories burned when exercising (source): Women: Calories = ( (Age x 0.074) — (Weight x 0.05741) + (Heart Rate x 0.4472) — 20.4022 ) x Time / 4.184 Men: Calories = ( (Age x 0.2017) + (Weight x 0.09036) + (Heart Rate x 0.6309) — 55.0969 ) x Time / 4.184 Write a program with inputs age (years), weight...