Assignment 14: More Variables and Printing
Code
/// Name: Ryan McAteer
/// Period: 5
/// Program Name: More Variables and Printing
/// File Name: Assignment14.java
/// Date Finished: 9/14/15
class Assignment14
{
public static void main(String[] args)
{
String ryanName, ryanEyes, ryanTeeth, ryanHair;
int ryanAge, ryanHeight, ryanWeight;
double cmHeight, kgWeight;
ryanName = "Ryan H.P. McAteer";
ryanAge = 16; // Truth
ryanHeight = 67; // inches
ryanWeight = 120; // lbs
ryanEyes = "Blue";
ryanTeeth = "White";
ryanHair = "Brown";
cmHeight = ryanHeight * 2.54;
kgWeight = ryanWeight * 0.453592;
System.out.println( "Let's talk about " + ryanName + "." );
System.out.println( "He's " + ryanHeight + " inches or " + cmHeight + " centimeters tall." );
System.out.println( "He's " + ryanWeight + " pounds or " + kgWeight + " kilograms." );
System.out.println( "Actually, that's not too heavy." );
System.out.println( "He's got " + ryanEyes + " eyes and " + ryanHair + " hair." );
System.out.println( "His teeth are usually " + ryanTeeth + " depending on the coffee." );
System.out.println( "If I add " + ryanAge + ", " + ryanHeight + ", and " + ryanWeight
+ " I get " + (ryanAge + ryanHeight + ryanWeight) + "." );
}
}
Picture of the output