-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumberAndMath.java
More file actions
81 lines (45 loc) · 2.05 KB
/
NumberAndMath.java
File metadata and controls
81 lines (45 loc) · 2.05 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package nyc.c4q.jvidals1;
/**
* Created by s3a on 3/3/15.
*/
public class NumberAndMath {
public static void main(String[] args) {
// creating a string
System.out.println( "I will now count my chickens:");
// concatenate a string and PEMDAS
System.out.println( "Hens " + ( 25 + 30 / 6 ) );
//added a line here using strings car
System.out.println( "Cars " + ( 100 - 50 * 10));
System.out.println( "Roosters " + ( 100 - 25 * 3 % 4 ) );
//added a line here
System.out.println( " Houses " + ( 9 - 3 % 2));
System.out.println( "Now I will count the eggs:" );
System.out.println( 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6 );
// added a lne
System.out.println( "Is it true that 3 + 2 < 5 - 7?" );
// Lets's test the declaration above
System.out.println( 3 + 2 < 5 - 7 );
System.out.println( 3 + 2 < 5 - 7 );
// Test
System.out.println( 5 + 6 > 2);
System.out.println( 9 + 10 == 2);
System.out.println( "What is 3 + 2? " + ( 3 + 2 ) );
// Add value and string
System.out.println( (3+ 10 *2) + "Sunglasses");
System.out.println( "What is 5 - 7? " + ( 5 - 7 ) );
// string and value
System.out.println( " What is 12 - 5 " + ( 12 - 5));
System.out.println( "Oh, that's why it's false." );
System.out.println( "How about some more." );
System.out.println( "Is it greater? " + ( 5 > -2 ) );
System.out.println( " Is it less than 5" + ( 2> 5));
System.out.println( "Is it greater or equal? " + ( 5 >= -2 ) );
System.out.println( "Is it less or equal? " + ( 5 <= -2 ) );
//Compute
System.out.println( .3 + .3 + .3 );
// True or False
System.out.println( .3 + .3 + .3 == .9);
//Compute
System.out.println( .23 * 3);
}
}