Assignemnt #14 and More Variables and Printing
Code
/// Name: Tristan Chung
/// Period: 5
/// Program Name: MoreVariablesAndPrinting
/// File Name: MoreVariablesAndPrinting.java
/// Date Finished: 9/15/2015
public class MoreVariablesAndPrinting
{
public static void main( String[] args )
{
String Name, Eyes, Teeth, Hair;
double Age, Height, Weight;
double Mass, Tall ;
Name = "Tristan A. Chung";
Age = 17; // not a lie
Height = 72.0; // inches
Weight = 135.0; // lbs
Eyes = "Brown";
Teeth = "White";
Hair = "Brown";
Mass = Weight * .453592 ;
Tall = Height * 2.54 ;
System.out.println( "Let's talk about " + Name + "." );
System.out.println( "He's " + Height + " inches (or " + Tall + " cm) tall." );
System.out.println( "He's " + Weight + " pounds (or " + Mass + " cm) heavy." );
System.out.println( "Actually, that's not too heavy." );
System.out.println( "He's got " + Eyes + " eyes and " + Hair + " hair." );
System.out.println( "His teeth are usually " + Teeth + " depending on the coffee." );
// This line is tricky; try to get it exactly right.
System.out.println( "If I add " + Age + ", " + Height + ", and " + Weight
+ " I get " + (Age + Height + Weight) + "." );
}
}
Picture of the output