Assignemnt #14
Code
/// Name: Daniel Nguyen
/// Period: 6
/// Program Name: VariablesAndPrinting Program
/// File Name: VariablesAndPrinting.java
/// Date Finished: 9/17/2015
// The inches to centimeters conversion is 1 to 2.54
public class MoreVariablesAndPrinting
{
public static void main( String[] args )
{
String Name, Eyes, Teeth, Hair;
int Age, Weight;
double CConversion, Height, HeightC;
Name = "Daniel T Nguyen";
Age = 16; // not a lie
Height = 70.00; // inches
Weight = 110; // lbs
Eyes = "Brown";
Teeth = "White";
Hair = "Brown";
CConversion = 2.54;
HeightC = Height * CConversion;
System.out.println( "Let's talk about " + Name + "." );
System.out.println( "He's " + Height + " inches tall. Or " + HeightC + " centimeters tall." );
System.out.println( "He's " + Weight + " pounds." );
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