星期四, 3月 02, 2006

JAVA Homework3



public class Homework3 {

public static void main(String[] args) {
//9224205
double personWeight = 150 / 2.2;
double runnung6MPH = 10; // 10 metabolic equivalents
double basketball = 8 ; // 8 metabolic equivalents
double sleeping = 1 ; // 1 metabolic equivalents
double runninh30Min=0.0175*runnung6MPH *personWeight*30;
double basketball30Min=0.0175*basketball *personWeight*30;
double sleeping6Hour=0.0175*sleeping *personWeight*360;

double totalNumberOfCalories = runninh30Min+basketball30Min+sleeping6Hour;
System.out.println("The Number Of running Calories"+runninh30Min+"Calories");
System.out.println("The Number Of basketball Calories"+basketball30Min+"Calories");
System.out.println("The Number Of sleeping Calories"+sleeping6Hour+"Calories");
System.out.println("Total Number Of Calories"+totalNumberOfCalories+"Calories");
}
}

0 Comments:

張貼留言

<< Home

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 Taiwan License.