Assignment #14 and More Variables And Printing
Code
/// Name: Graham Pollock
/// Period: 5
/// Program Name: More Variables And Printing
/// File Name: MoreVariablesAndPrinting.java
/// Date Finished: 9/14/2015
public class MoreVariablesAndPrinting
{
public static void main( String[] args )
{
String Name, Eyes, Teeth, Hair;
int Age, Height, Weight;
double Inches, Centimeters, Pounds, Kilograms;
Name = "Joshua P. Davis";
Age = 36;
Height = 74;
Weight = 235;
Eyes = "Hazel";
Teeth = "White";
Hair = "Brown";
Inches = 2.54;
Centimeters = 0.39370;
Pounds = 2.2046;
Kilograms = 2.2046;
double newKG = Math.round(Weight/Kilograms);
double newCM = Math.round(Height*Centimeters);
System.out.println( "Let's talk about " + Name + "." );
System.out.println( "He's " + Height + " inches tall." + "(Or " + newCM + " cm)" );
System.out.println( "He's " + Weight + " pounds." + "(Or " + newKG + " cm)" );
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) + "." );
System.out.println( );
}
}
Picture of the output