Assignment #14 More Variables and Printing
Code
/// Name: Koosha Kimelman
/// Period: 7
/// Program Name: More Variables and Printing
/// File Name: MoreVariablesAndPrinting.java
/// Date Completed: 9/11/15
public class MoreVariablesAndPrinting {
public static void main( String[] args ) {
String Name, Eyes, Teeth, Hair;
double Age, Height, Weight, CmHeight, KgWeight;
Name = "Joshua P. Davis";
Age = 36;
Height = 74; // inches
CmHeight = Height * 2.54; // conversion rate
Weight = 235; // lbs
KgWeight = Weight * 0.453592; // conversion rate
Eyes = "Hazel";
Teeth = "White";
Hair = "Brown";
System.out.println( "Let's talk about " + Name + "." );
System.out.println( "He's " + Height + " inches tall." + "(Which is " + CmHeight + " in centimeters)" );
System.out.println( "He's " + Weight + " pounds." + "(Which is " + KgWeight + " in kilograms)" );
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." );
System.out.println( "If I add " + Age + ", " + Height + ", and " + Weight
+ " I get " + (Age + Height + Weight) + "." );
}
}
Picture of the output