import java.util.Scanner;
public class IdealWeight
{
public static void main (String[] args)
{
Scanner keyboard = new Scanner (System.in);
int heightFeet, heightInches, totalInches, leftoverInches;
System.out.print ("What is your height in feet?");
heightFeet = keyboard.nextInt ();
System.out.println ("Wow, how many inches tall are you?");
heightInches = keyboard.nextInt ();
totalInches = (heightFeet * 12) + heightInches;
leftoverInches = totalInches - 60;
int girlWeight = 100 + (5 * leftoverInches);
int boyWeight = 106 + (6 * leftoverInches);
System.out.println ("If you are a girl, you should weigh " +girlWeight);
System.out.println ("If you are a boy, you should weigh " +boyWeight);
}
}
public class IdealWeight
{
public static void main (String[] args)
{
Scanner keyboard = new Scanner (System.in);
int heightFeet, heightInches, totalInches, leftoverInches;
System.out.print ("What is your height in feet?");
heightFeet = keyboard.nextInt ();
System.out.println ("Wow, how many inches tall are you?");
heightInches = keyboard.nextInt ();
totalInches = (heightFeet * 12) + heightInches;
leftoverInches = totalInches - 60;
int girlWeight = 100 + (5 * leftoverInches);
int boyWeight = 106 + (6 * leftoverInches);
System.out.println ("If you are a girl, you should weigh " +girlWeight);
System.out.println ("If you are a boy, you should weigh " +boyWeight);
}
}
(0) Comments
Post a Comment