Assignment #13, Creating Variables
Code
///Name:Stella Koliavas
//P:5
//Program: 14
//File Name: More Variables And Printing
//Finished: 9/21/15
public class MoreVariablesAndPrinting
{
public static void main( String[] args )
{
String Name, Eyes, Teeth, Hair;
int Age;
Double Height, Weight;
Name = "Stella Koliavas";
Age = 17; // not a lie
Height = 65 * 2.54; // inches to cm
Weight = 160 * 0.453592; // pounds to kilos
Eyes = "Hazel";
Teeth = "Sparkling White";
Hair = "Beautiful Brown";
System.out.println( "Let's talk about " + Name + "." );
System.out.println( "She's " + Height + " cm tall." );
System.out.println( "She's " + Weight + " kilos." );
System.out.println( "Actually, that's so very light ." );
System.out.println( "She's got " + Eyes + " eyes and " + Hair + " hair." );
System.out.println( "Her teeth are usually " + Teeth + " depending on the toothpaste she uses." );
System.out.println( "If I add " + Age + ", " + Height + ", and " + Weight
+ " I get " + (Age + Height + Weight) + "." );
}
}
Picture of the output