Assignemnt #14 and More Variables and Printing

Code


///Name: Ben Borglin
///Period: 6
///Program Name: More Variables and Printing
///File Name: MoreVariablesAndPrinting.java
///Date Finished: 9/10/2015
public class MoreVariablesAndPrinting
{
    public static void main( String[] args )
    {
        String myName, myEyes, myTeeth, myHair;
        int myAge, myHeight, myWeight;
        Double myHeightCenti, myWeightKilo;
        myName = "Ben K. Borglin";
        myAge = 16;     // not a lie
        myHeight = 71;  // inches
        myWeight = 140; // lbs
        myHeightCenti = myHeight*2.54; //centimeters
        myWeightKilo = myWeight*.453592; //kilos
        myEyes = "Blue";
        myTeeth = "White";
        myHair = "Blonde";
        System.out.println( "Let's talk about " + myName + "." );
        System.out.println( "He's " + myHeight + " Inches(or " + myHeightCenti + " cm) tall." );
        System.out.println( "He's " + myWeight + " lbs (or " + myWeightKilo + " kilo)." );
        System.out.println( "Actually, that's not too heavy." );
        System.out.println( "He's got " + myEyes + " eyes and " + myHair + " hair." );
        System.out.println( "His 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

Assignment 14