ExpressionsThing.java
1    /* 
2     * Program to mess around with and hopefully 
3     * learn a little bit about expressions in java 
4     */
5    
6    
7    package expressions;
8    
9    public class ExpressionsThing {
10   
11       public static void main(String[] args) {
12           //task 3
13           double one = 3.14*5+5;
14           System.out.println("one = " + one);
15           double two = 3.14*(5+5);
16           System.out.println("two = " + two);
17           double three = ( 3.14*(5+5));
18           System.out.println("three = " + three);
19   
20           //task 4
21           int four = (5*6);
22           System.out.println("four = " + four);
23           double five = ((1/2.0)*55);
24           System.out.println("five = " + five);
25           double six = ((1/3.0)*65);
26           System.out.println("six = " + six);
27           double seven = (five + six);
28           System.out.println("seven = " + seven);
29   
30           //task 5
31           double eight = (3.14*(11.3*11.3));
32           System.out.println("eight = " + eight);
33           double nine = (27.7*27.7);
34           System.out.println("nine = " + nine);
35           double ten = (0.5*(eight+nine));
36           System.out.println("ten = " + ten);
37           double eleven = (0.17*(243.5));
38           System.out.println("eleven = " + eleven);
39   
40           //task 6
41           double twelve = (3/3.0);
42           System.out.println("twelve = " + twelve);
43           int thirteen = (7-(4+2));
44           System.out.println("thirteen = " + thirteen);
45           int fourteen = ((9-7)+(3-1));
46           System.out.println("fourteen = " + fourteen);
47           int fifteen = (2+2+4+(8-6));
48           System.out.println("fifteen = " + fifteen);
49       }
50   }
51