ExpressionsThing.java
1    package expressions;
2    
3    public class ExpressionsThing {
4    
5        public static void main(String[] args) {
6    
7    //    }
8    //
9    //    {
10           // Task 3: Three related expressions
11           double one = 3.14 * 5 + 5;
12           System.out.println("one = " + one);
13           double two = 3.14 * (5 + 5);
14           System.out.println("two = " + two);
15           double three = (3.14 * (5 + 5));
16           System.out.println("three = " + three);
17   
18   
19   
20           // Task 4: Translating fully-parenthesized arithmetic expressions from English
21           int four = ((2 * 3) - 2);
22           System.out.println("four = " + four);
23   
24           double five = ((55 / 2) - 22.5);
25           System.out.println("five = " + five);
26   
27           double six = ((65 / 3) - 15.6666667);
28           System.out.println("six = " + six);
29   
30           double seven = (((55 / 2) + (65 / 3)) - 42.1666667);
31           System.out.println("seven = " + seven);
32   
33   
34   
35           // Task 5: Computations based on simple geometric/algebraic conceptions
36           double eight = (3.14 * (11.3 * 11.3));
37           System.out.println("eight = " + eight);
38           double nine = (27.7 * 27.7);
39           System.out.println("nine = " + nine);
40           double ten = ((3.14* (11.3 * 11.3)) + (27.7 * 27.7));
41           System.out.println("ten = " + ten);
42           double eleven = (243.5 * 0.17);
43           System.out.println("eleven = " + eleven);
44   
45   
46           // Task 6: Simple computations to solve Crypto problems
47           int twelve = (3 / 3);
48           System.out.println("twelve = " + twelve);
49           int thirteen = ((7 - 4) - 2);
50           System.out.println("thirteen = " + thirteen);
51           int fourteen = ((9 - 7) + (3 - 1));
52           System.out.println("fourteen = " + fourteen);
53           int fifteen = ((((4 * 8) / 2) - 6) / 2);
54           System.out.println("fifteen = " + fifteen);
55   
56   
57   
58       }
59   }