-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMoreVariablesAndPrinting.java
More file actions
50 lines (36 loc) · 1.15 KB
/
MoreVariablesAndPrinting.java
File metadata and controls
50 lines (36 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package nyc.c4q.jvidals1;
/**
* Created by s3a on 3/3/15.
*/
//Exercise
public class MoreVariablesAndPrinting {public static void main( String[] args )
{
/*Sample
String Name, Eyes, Teeth, Hair;
int Age;
double Height;
double Weight;
*/
//My Sample
String Name, Eyes, Hair;
int Age;
double Height;
double Weight;
Name = "Zed A. Shaw";
Age = 35; // not a lie
Height = 187.96; // inches
Weight = 180 * 2.2; // lbs
Eyes = "Blue";
String Teeth = "white";
Hair = "Brown";
System.out.println( "Let's talk about " + Name + "." );
System.out.println( "He's " + Height + " centimeters tall." );
System.out.println( "He's " + Weight + " kilos heavy." );
System.out.println( "Actually, that's not too heavy." );
System.out.println( "He's got " + Eyes + " eyes and " + Hair + " hair." );
System.out.println( "His teeth are usually " + Teeth + " depending on the coffee." );
// This line is tricky; try to get it exactly right.
System.out.println( "If I add " + Age + ", " + Height + ", and " + Weight
+ " I get " + (Age + Height + Weight) + "." );
}
}