Assignemnt 14 and More Variables and Printing
Code
/// Name: Xinting Chen
/// Period: 5
/// Program Name: More Variables and Printing
/// File Name: MoreVariablesAndPrinting.java
/// Date Finished: 9/21/2015
public class MoreVariablesAndPrinting
{
public static void main( String[] args )
{
String myName, myEyes, myTeeth, myHair;
int myAge, myHeight, myWeight;
myName = "Xinting Chen";
myAge = 18; // not a lie
myHeight = 62; // inches
myWeight = 100; // lbs
myEyes = "Brown";
myTeeth = "White";
myHair = "Black";
System.out.println( "Let's talk about " + myName + "." );
System.out.println( "I'm" + myHeight + " inches" + "(or"+ myHeight*2.45+"cm) tall." );
System.out.println( "I'm " + myWeight + " pounds" + "(or" +myWeight*0.453592+"kg) heavy." );
System.out.println( "Actually, that's not too heavy." );
System.out.println( "I got " + myEyes + " eyes and " + myHair + " hair." );
System.out.println( "My teeth are usually " + myTeeth + " depending on the coffee." );
// This line is tricky; try to get it exactly right.
System.out.println( "If I add " + myAge + ", " + myHeight + ", and " + myWeight
+ " I get " + (myAge + myHeight + myWeight) + "." );
}
}
Picture of the output