Professional Documents
Culture Documents
Lab Exercise Week 2 (Basic Class) Part 1
Lab Exercise Week 2 (Basic Class) Part 1
Question 1
Complete the following Java program by answering Question 1 (a), (b) and (c).
import java.util.Scanner;
import java.lang.Math;
import java.text.*;
// 1 (a)
//1 (b)
//1 (c)
25 – 29.9 Overweight
30 – 34.9 Obese
if(bmi>=35){status=”Extremely Obese”;}
else if (bmi>=30 && bmi <=34.9){status=”Obese”;}
else if (bmi>=25 && bmi<=29.9){status=”Overweight”;}
else if (bmi>=18.5&& bmi <= 24.9){status=”Normal”;}
else if (bmi<=18.5 && bmi >0){status=”Underweight”;}
else{status=”Invalid”;}
Question 2
import java.util.Scanner;