PROGRAMMING AND CODE


Assignemnt #19

Code

  /// Name: Justin Li
  /// Period 7
  /// Program Name: Asking Questions
  /// File Name: AskingQuestions.java
  /// Date Finished: 9/23/15

  import java.util.Scanner;

      public class AskingQuestions
  {
      public static void main( String[] args )
	   {
          Scanner keyboard = new Scanner(System.in);
          
          int age;
		  String height, feet, inches;
		  double weight;

          System.out.print( "How old are you? " );
          age = keyboard.nextInt();

		  System.out.print( "How many feet are you? " );
		  feet = keyboard.next();
          
          System.out.print( "How many inches are you? " );
		  inches = keyboard.next();

          System.out.print( "How much do you weigh? " );
          weight = keyboard.nextDouble();

		  System.out.println( "So you're " + age + " old, " + feet +"'" + inches + "' tall and " + weight + " pounds." );
	   }
  }
    

Picture of the output

Assignment 1