Assignemnt #14, More Variables and Printing
Code
/// Name: Alex Pinder
/// Period: 5
/// Program Name: More Variables And Printing
/// File Name: MoreVariablesAndPrinting.java
/// Date Finished: 9/16/2015
public class MoreVariablesAndPrinting
{
public static void main( String[] args )
{
String Name, Eyes, Teeth, Hair;
int Age, Height, Weight;
double height_in_cm, weight_in_kilos;
Name = "Alex C. Pinder";
Age = 16;
Height = 77;
height_in_cm = Height * 2.54;
Weight = 170;
weight_in_kilos = Weight * 0.453592;
Eyes = "Hazel";
Teeth = "White";
Hair = "Light Brown";
System.out.println( "Let's talk about " + Name + "." );
System.out.println( "He's " + Height + " inches tall. (" + height_in_cm + " centameters)" );
System.out.println( "He's " + Weight + " pounds. (" + weight_in_kilos + " kilograms)" );
System.out.println( "He's got " + Eyes + " eyes and " + Hair + " hair." );
System.out.println( "His teeth are usually " + Teeth + "." );
System.out.println( "If I add " + Age + ", " + Height + ", " + Weight + " I get " + (Age + Height + Weight) + "." );
}
}
Picture of the output