1 /* 2 * A program to utilize math functions and parenthesized instructions 3 */ 4 5 package expressions; 6 7 public class ExpressionsThing { 8 public static void main(String[] args) { 9 double one = 3.14 * 5+5; 10 System.out.println("one =" + one); 11 12 double two = 3.14 * (5+5); 13 System.out.println("two =" + two); 14 15 Double three = ( 3.14 * ( 5 + 5)); 16 System.out.println("three =" + three); 17 // when run we se that double statement is the only correct one because it's parenthesized!! 18 19 int four = (2*3); 20 System.out.println("four =" + four); 21 // We use int because it's a integer if a decimal we use double 22 23 double five = (.5 * 55); 24 System.out.println("five =" + five); 25 // We used double because we have the decimal .5 * 55 which is equivalent to half 26 27 double six = (.333 * 65); 28 System.out.println("six =" + six); 29 30 double seven = ((.5 * 55) + (.333 * 65)); 31 System.out.println("seven =" + seven); 32 // So I see that double will still work for a decimal number here it prints out 49.1449 but rounds the 4to5 33 34 double eight = (3.14 * (11.3 * 11.3)); 35 System.out.println("eight =" + eight); 36 //radius of a circle PI * R^2 37 38 double nine = ( 27.7 * 27.7); 39 System.out.println("nine = " + nine); 40 // Area of a square is S * S 41 42 double ten = (((3.14 * (11.3 * 11.3)) + (27.7 * 27.7)) / 2); 43 System.out.println("ten =" + ten); 44 // Had several wrong answers until i got the parenthesis right. Must be in the right spots 45 //This computes the average of a square + radius of a given circle 46 47 double eleven = (.017 * 243.5) ; 48 System.out.println("eleven =" + eleven); 49 // this will calculate 17 percent of 243.5 50 51 int twelve = (3/3); 52 System.out.println("twelve =" + twelve); 53 54 int thirteen = (7- (4 + 2)); 55 System.out.println("thirteen =" + thirteen); 56 57 int fourteen = ( (9 + 3) - (7 + 1)); 58 System.out.println("fourteen =" + fourteen); 59 60 int fifteen = (((6 + 8 )/ 2 + 2) - 4); 61 System.out.println("fifteen =" + fifteen); 62 63 64 65 } 66 67 68 69 70 71 72 73 } 74