package expressions; /*program to explore expressions *for simple *problem solving */ public class ExpressionsThing { public static void main(String[] args){ double one = Math.PI * 5 + 5; System.out.println("one = " + one); double two = Math.PI * (5 + 5); System.out.println("Two = " + two); double three = (Math.PI * ( 5 + 5)); System.out.println("Three = " + three); int four = (2 * 3); System.out.println("Four = " + four); double five = (55 * 0.5); System.out.println("Five = " + five); double six = (65 * 0.333); System.out.println("Six = " + six); double seven = five + six; System.out.println("Seven = " + seven); double eight = (Math.PI * (11.3 * 11.3)); System.out.println("eight = " + eight); double nine = (27.7 * 27.7); System.out.println("nine = " + nine); double ten = ((eight + nine) / 2); System.out.println("ten = " + ten); double eleven = (243.5 * 0.17); System.out.println("Eleven = " + eleven); int twelve = (3 / 3); System.out.println("Twelve = " + twelve); //thirteen uses 4,7,2 I want 1 int thirteen = ((7 - 2) - 4); System.out.println("Thirteen = " + thirteen); //1, 3, 7, 9 with 4 as goal int fourteen = ((9 - 7) + (3 - 1)); System.out.println("Fourteen = " + fourteen); // 2,2,4,6,8 with 5 as goal int fifteen = (6 - ((4 + (2 * 2)) /8)); System.out.println("Fifteen = " + fifteen); //one produces an incorrect result //three is fully parenthesized } }