1 /* 2 * First program to construct the arithmetic expressions 3 * in the simple way of problem solving. 4 */ 5 package expressions; 6 7 import javax.swing.*; 8 import java.net.SocketOption; 9 10 public class ExpressionsThing<four> { 11 public static void main(String[] args) { 12 13 double one = 3.14 * 5 + 5; 14 System.out.println("one=" + one); 15 16 double two = 3.14 * (5 + 5); 17 System.out.println("two=" + two); 18 19 double three = (3.14 * (5 + 5)); 20 System.out.println("three=" + three); 21 22 23 // In this part we are going to add more expressions using another type of data int. 24 //We are adding the variable in the following lines 25 int four = (2 * 3); 26 System.out.println("four=" + four); 27 28 double five= (1/2.0* 55); 29 System.out.println("five="+five); 30 31 double six= (1/3.0* 65); 32 System.out.println("six="+six); 33 34 double seven= ((1/2.0* 55)+(1/3.0 *65)); 35 System.out.println("seven="+seven); 36 37 // Adding more pairs of statements introducing solutions 38 // Introducing simple geometric and algebraic expressions 39 40 //area of a circle with r= 11.3 41 double eight= (3.14*(11.3*11.3)); 42 System.out.println("eight="+eight); 43 44 //Area of a square with s=27.5 45 double nine= (27.7*27.7); 46 System.out.println("nine="+nine); 47 48 //average value of eight and nine 49 double ten= ((eight+nine)/2); 50 System.out.println("ten="+ten); 51 52 //17 percent of 243.5 53 double eleven= (17/100.0*243.5); 54 System.out.println("eleven="+eleven); 55 56 //using 3 and 3 to evaluate the value 1 57 int twelve= (3/3); 58 System.out.println("twelve="+twelve); 59 60 //using the numbers 4 and 7 and 2 to get the number 1 as goal 61 int thirteen= (7-(4+2)); 62 System.out.println("thirteen="+thirteen); 63 64 //1 and 3 and 7 and 9 to get the goal 4 65 int fourteen= ((3-1)+(9-7)); 66 System.out.println("fourteen="+fourteen); 67 68 //2 and 2 and 4 and 6 and 8 to get the number 5 as goal 69 70 int fifteen= ((2+4)-((6+2)/8)); 71 System.out.println("fifteen="+fifteen); 72 73 74 } 75 76 }