Advertisement
MrsMcLead

Input

Feb 10th, 2014
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Input
  4. {
  5.   public static void main(String[]args)
  6.   {
  7.     Scanner scanner = new Scanner(System.in);
  8.     System.out.println("How old are you?");
  9.     int age = scanner.nextInt();
  10.     System.out.println("You are " + age + " years old.");
  11.    
  12.     System.out.println("How tall are you in inches?");
  13.     int height = scanner.nextInt();
  14.    
  15.     System.out.println("You are " + height/12 + " feet  and " + height%12 + " inches tall.");
  16.    
  17.    
  18.    
  19.   }  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement