package expressions; public class ExpressionsThing { public static void main(String[] args){ double one = 3.14 * 5 + 5; System.out.println("One = " + one); double two = 3.14 * (5 + 5); System.out.println("Two = " + two); double three = (3.14 * (5 + 5)); System.out.println("Three = " + three); /* * Double one is incorrect due to lack of use of parentheses. * Double two is correct but is not fully parenthesised. * Double three is correct and gully parenthesised. */ int four = (2 * 3); System.out.println("Four = " + four); double five = (55.0/2.0); System.out.println("Five = " + five); double six = (65.0/3); System.out.println("Six = " + six); double seven = (((55.0/2.0)+(65.0/3.0))); System.out.println("Seven = " + seven); double eight = (3.14*(11.3*11.3)); System.out.println("Eight = " + eight); double nine = (27.7*27.7); System.out.println("Nine = " + nine); double ten = ((3.14*(11.3*11.3)) + (27.7*27.7)); System.out.println("Ten = " + ten); double eleven = (243.5*0.17); System.out.println("Eleven = " + eleven); //Crypto Problems // using 3 and 3 to get 1 as the desired outcome int twelve = (3/3); System.out.println("Twelve = " + twelve); //using 4,7 and 2 to get 1 as the desired outcome int thirteen = ((4*2)-7); System.out.println("Thirteen = " + thirteen); //using 1,3,7 and 9 to get 4 as the desired outcome int fourteen = ((9+7)/(3+1)); System.out.println("Fourteen = " + fourteen); //using 2,2,4,6 and 8 to get 5 as the desired outcome int fifteen = ((((6+4)*(2+2)/8))); System.out.println("Fifteen = " + fifteen); } }