-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreatingVariables.java
31 lines (26 loc) · 993 Bytes
/
CreatingVariables.java
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
public class CreatingVariables {
public static void main( String[] args ) {
int x, y, age, age2;
double seconds, e, checking, p;
String firstName, lastName, title, author;
x = 10;
y = 400;
age = 39;
age2 = 44;
seconds = 4.71;
e = 2.71828182845904523536;
checking = 1.89;
p = 3.141592653598974323846;
firstName = "Graham";
lastName = "Mitchell";
title = "Mr.";
System.out.println( " The variable x contains " + x);
System.out.println( "The value " + y + " is stored in the variable y. " );
System.out.println( "The experiment took " + seconds + "seconds." );
System.out.println( " A favorite irrational # is Euler's number: " + e );
System.out.println( "Hopefully you have more than $" + checking + "!" );
System.out.println( " My name's " + title + " " + firstName + lastName );
System.out.println( "In 5 years Mr. Mitchell will be " + age2 + " years old." );
System.out.println( "Another great irrational # is Pi: " + p );
}
}