Assignment #14 and MoreVariablesAndPrinting
Code
/// Name: Jack Newsom
/// Period: 5
/// Program Name: MoreVariablesAndPrinting
/// Filename: MoreVariablesAndPrinting.java
/// Date Finished: 9/11/15
public class MoreVariablesAndPrinting
{
public static void main( String[] args )
{
String Name, Eyes, Teeth, Hair;
double Age, Height, Weight, heightEuro, weightEuro;
Name="Jack Newsom";
Age=17; //probably a lie
Height=72; //inches
heightEuro= Height * 2.54;
Weight=150;
weightEuro= Weight * .453592;
Eyes="blue";
Teeth="white";
Hair="brown";
System.out.println( "Let's talk about " + Name + "." );
System.out.println( "He's " + Height +" (that's "+ heightEuro +" centimeters!)" + " inches tall." );
System.out.println( "He's " + Weight +" (that's "+ weightEuro +" kilograms!)" + " 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