Assignment #15 Using Variables
Code
/// Name: Drew Boxold
/// Period: 5
/// Program Name: 15
/// File Name: UsingVariables.java
/// Date Finished: 9/22/2015
public class UsingVariables
{
public static void main( String[] args )
{
String myFirst, myMiddle, myLast;
int myAge;
double myHeight, myWeight;
myFirst = "Drew";
myMiddle = "Thomas";
myLast = "Boxold";
myAge = 18; // not a lie
myHeight = 74.5; // inches
myWeight = 170.5; // pounds
System.out.println( "Let's talk about " + myFirst + myMiddle + myLast + "." );
System.out.println( "He's " + myWeight + " pounds." );
System.out.println( "He's " + myHeight + " inches tall." );
System.out.println( "He is a pretty cool cat." );
System.out.println( "If I add " + myAge + "in years, " + myHeight + ", and " + myWeight
+ " I get " + (myAge + myHeight + myWeight) + "." );
}
}
Picture of the output