Hello, so i have a program here and i wanted to know how do i make a demo to test the class
I do not know if i need to edit the program i have so it is able to understand the demo.
Also i wanted to know when you are compiling the program, do you compile both at the same time? how does it put the two seperate programs together?
Anyways here is the program:
<package my_bmi; import java.util.Scanner; public class My_BMI_3 { public static void main(String[] args) { String name; //name of BMI person int Weight; //weight in pounds int Height; //height in inches double bmi; // BMI System.out.println ("This Java program calculates your BMI"); Scanner KB = new Scanner (System.in); System.out.print ("Please enter your name: "); name= KB.nextLine(); System.out.print ("Please enter your weight in pounds: "); Weight= KB.nextInt(); System.out.print ("Please enter your height in inches: "); Height= KB.nextInt(); bmi = (Weight *703)/(Height * Height); System.out.println ( name + " for your weight: " + Weight + " and height: " + Height); if (bmi<18.5) { System.out.print ("According to your BMI you are underweight."); } if (bmi>= 18.5 && bmi<25) { System.out.print ("According to your BMI you are normal weight."); } if (bmi>= 25 && bmi<30) { System.out.print ("According to your BMI you are overweight."); } if (bmi>=30) { System.out.print ("According to your BMI you are obese."); } System.out.print ("\n"); System.out.println ("Thank you for using the BMI program. Good bye"); } }>