วันอาทิตย์ที่ 23 สิงหาคม พ.ศ. 2558

Lab 1 - BMI Calculate

void setup() {

  float tallcm = 176;
  double tallm = tallcm*1e-2;
  float mass = 62;
  double bmi = mass/(tallm*tallm);
 
 
  //Centimeters
  print("Your Height is "+ tallcm);
  println(" Centimeters");
 
  //Kilograms
  print("Your Weight is "+ mass);
  println(" Kilograms");
 
  //BMI
  print("Your BMI is "+ bmi);
 
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น