1 package expressions; 2 3 /* 4 * This program demonstrates how to use arithmetic expressions properly in Java. 5 */ 6 7 public class ExpressionsThing 8 { 9 public static void main(String[] args) 10 { 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 = " + two); 17 18 int four = (2 * 3); 19 System.out.println("four = " + four); 20 double five = (0.5 * 55); 21 System.out.println("five = " + five); 22 double six = ((1.0/3) * 65); 23 System.out.println("six = " + six); 24 25 double seven = (five + six); 26 System.out.println("seven = " + seven); 27 //Computations based on simple geometric/algebraic conceptions 28 double eight = (Math.PI * (Math.pow(11.3, 2))); 29 System.out.println("eight = " + eight); 30 double nine = (27.7 * 27.7); 31 System.out.println("nine = " + nine); 32 33 double ten = ((eight + nine)/2); 34 System.out.println("ten = " + ten); 35 double eleven = (0.17 * 243.5); 36 System.out.println("eleven = " + eleven); 37 // Crypto 38 int twelve = (3/3); 39 System.out.println("twelve = " + twelve); 40 int thirteen = ((7 - 2) - 4); 41 System.out.println("thirteen = " + thirteen); 42 int fourteen = ((9 + 7) / (1 + 3)); 43 System.out.println("fourteen = " + fourteen); 44 int fifteen = (8 - (((6 - 4) / 2) + 2)); 45 System.out.println("fifteen = " + fifteen); 46 47 } 48 } 49