// CSE 142, Spring 2010, Marty Stepp // This program prompts for the height of a person and prints // whether each one is considered tall, medium, or short. // The program demonstrates the Scanner object and nested if/else statements. // This initial version is not as good as Taller2.java. import java.util.*; // so that I can use Scanner public class Taller { public static void main(String[] args) { Scanner console = new Scanner(System.in); // prompt/read height System.out.print("Height in feet and inches? "); int feet = console.nextInt(); int inches = console.nextInt(); // print message about height range if ((feet == 5 && inches < 3) || feet < 5) { System.out.println("You are short."); } else if (feet == 5 && inches >= 3 && inches <= 11) { System.out.println("You are medium."); } else { System.out.println("You are tall."); } } }