import java.util.Scanner;
/*
1. System.out.println("The number of characters is:" + n);
2. Scanner in = new Scanner(System.in);
int age1;
System.out.print("What is your age?:");
age1 = in.nextInt();
System.out.println("Your age is:" + age1);
3. Prints
5
HY Mystery
/*********************************************
*/
public class Assignment1
{
public static void main(String[] args)
{
int feet, inches, height1;
double height;
Scanner in = new Scanner(System.in);
System.out.print("What is your name? ");
String name = in.next();
System.out.println("What is your height? ");
System.out.print("Feet: ");
feet = in.nextInt();
System.out.print("Inches: ");
inches = in.nextInt();
height = ((feet * 12) + inches) * 2.54 / 100;
System.out.println(name +", your height is "+height);
}
}
Powered by TCPDF (www.tcpdf.org)
//***********************************************************
// Name:
// Title: Assignment1.java
// Description: Get input from user
// Time spent:
// Date: 9/3/2015
//**************************************************************