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 formula:
Calories/Minute = 0.0175 × MET × Weight(Kg)
Write a program that calculates and outputs the tot al 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.
You must create a class level/scope variable for every "constant"
value that you have, such as the number of METS per each activity -
there are several others as well that will not change no matter how
many different scenarios this program is run for, so make sure they
are all defined this way and other values that could vary if you
ran it for different people/scenarios can be declared as method
level/scope variables (in your main() method in this case). For
now, declare all of your class level/scope variables as "public
static final".
ANSWER:
source code:
language:Java
import java.text.DecimalFormat;
class energy{
public static void main(String args[]){
//declaring important constants with MET values
final int running=10;//MET for running is 10,according to the question
final int basketball=8;//MET for basketball is 8,according to the question
final int sleeping=1;//MET for sleeping is 1,according to the question
int weight=150;//given that person weight is 150 pounds
double weight_in_kg;//for calculating weight in kilograms
weight_in_kg=weight/2.2;//1kg=2.2 pounds,based on that calculating kilogram value
double energy_running;//to store energy used for running
energy_running=0.0175*running*weight_in_kg*30;//calculating based on given formula,multiplying with 30,here 30 is minutes
double energy_basketball;//to store energy used for basketball
energy_basketball=0.0175*basketball*weight_in_kg*30;//calculating based on given formula,multiplying with 30,here 30 is minutes
double energy_sleeping;//to store energy used for sleeping
energy_sleeping=0.0175*sleeping*weight_in_kg*(6*60);//calculating based on given formula,multiplying with (6*60),here (6*60) is minutes
double total;//to store total number of calories
total=energy_running+energy_basketball+energy_sleeping;//adding all
calculated energies,to get final amount of energy
DecimalFormat formatter = new DecimalFormat(".##");
//to print upto 2 decimal places only
System.out.println("total amount of energy used in
terms of calories is :" + formatter.format(total));
}
}
output:
One way to measure the amount of energy that is expended during exercise is to use...
Lab Exercise 05.1 Interest Rate PLEASE USE JAVA Compound interest is the way that you can turn a little bit of money into a lot of money, if you have enough time. We have seen this calculation in a previous lab. This exercise will rewrite the program but will define a class named interestRate which will contain several separate methods. These methods will be incorporated into the class definition so that they can be tested by a main test program...
Here’s your task: You’re going to create exactly two classes. One class will act as the functional server. The main method of this server will setup the connection on a localhost, find the two clients, let them know which one is Player 1 and which one is Player 2 (depending on the order they connect), and then manage the game as it’s being played. This is important: For each player’s turn they should start by displaying their current score to...
Hi, Kindly assist with my project management assignment below using the attached case study Question 1 Update the project charter for the remainder of the project in response to Adams’ memo (lines 241 through 246). Question 2 Prepare a plan for the remainder of the project in response to Adams’ memo (lines 241 through 246). Your answers to the above will be assessed in terms of the level of communication displayed, the insights and inferences drawn, and your ability to...
10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated sludge operation that adversely affect effluent quality with origins in the engineering, hydraulic and microbiological components of the process. The real "heart" of the activated sludge system is the development and maintenance of a mixed microbial culture (activated sludge) that treats wastewater and which can be managed. One definition of a wastewater treatment plant operator is a "bug farmer", one who controls the aeration...