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

Lab1-BMI

void setup(){
 float high = 173; //Height in centimeters
 float weight = 60; //Weight in kilograms
 float highM = high/100; //Height in meters
 float BMI; //Body Mass Index

 /////Calculate/////
 BMI = weight/(highM*highM);

 /////Show Value/////
 size(450,200);
 background(#99FFFF);
 textSize(30);
 fill(#008B00);
 text("Weight = "+weight+" kg",25,50);
 text("Height = "+high+" cm",25,100);
 fill(#FF0000);
 text("BMI = "+BMI,25,150);
}


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

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