Assignemnt #14 More Variables And Printing
Code
/// Name: Brendan Miller
/// Period: 5
/// Program Name: MoreVariables And Printing
/// File Name: MoreVariablesAndPrinting.java
/// Date Finished: 9/21/2015
public class MoreVariablesAndPrinting
{
public static void main( String[] args )
{
String Name, Eyes, Teeth, Hair;
int Age, Height, Weight;
double Weightinkg, Heightincm;
Name = "Brendan J. Miller";
Age = 17; // not a lie
Height = 71; // inches
Weight = 190; // lbs
Eyes = "Brown";
Teeth = "White";
Hair = "Brown";
Weightinkg = (71 * 2.54);
Heightincm = (190 * .453);
System.out.println( "Let's talk about " + Name + "." );
System.out.println( "He's " + Height + " (or " + Heightincm + " cm) inches" );
System.out.println( "He's " + Weight + " (or " + Weightinkg + " kg) 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 milk." );
// 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