/** * Write a description of class opSwitch here. * * @author (your name) * @version (a version number or a date) */ public class opSwitch { public static void choose(String opInput){ simpleOp op = new simpleOp(); String x; String y; // switchboard for operations switch (opInput) { case "?": System.out.println("Commands include:\n" +"+"+"\n" +"-"+"\n" +"*"+"\n" +"/"+"\n" +"square"+"\n" +"square root"+"\n" +"exponent"+"\n" +"inverse"+"\n" +"invert"+"\n" +"quit"+"\n" +"clear"+"\n" +"reset"+"\n" +"x rooted WIP"+"\n" +"log WIP"+"\n" +"ln WIP"+"\n" +"log (CHANGE OF BASE ) WIP"+"\n" +"sin WIP"+"\n" +"cos WIP"+"\n" +"tan WIP"+"\n" +"inverse of sin WIP"+"\n" +"inver of cos WIP"+"\n" +"inverse of tan WIP"+"\n"); break; case "+": //x = Console.getStringInput("Please enter first number."); y = Console.getStringInput("Please enter number."); simpleOp.add(op.currentNumber, Console.getNumber(y)); break; case "-": //x = Console.getStringInput("Please enter first number."); y = Console.getStringInput("Please enter number."); simpleOp.sub(op.currentNumber, Console.getNumber(y)); break; case "*": //x = Console.getStringInput("Please enter multiplicand."); y = Console.getStringInput("Please enter number."); simpleOp.mul(op.currentNumber, Console.getNumber(y)); break; case "/": //x = Console.getStringInput("Please enter dividend."); y = Console.getStringInput("Please enter number."); simpleOp.div(op.currentNumber, Console.getNumber(y)); break; case "square": //x = Console.getStringInput("Please enter your number."); simpleOp.squ(op.currentNumber); break; case "square root": //x = Console.getStringInput("Please enter your number."); simpleOp.sqrt(op.currentNumber); break; case "exponent": //x = Console.getStringInput("Please enter base."); y = Console.getStringInput("Please enter the exponent."); simpleOp.exp(op.currentNumber, Console.getNumber(y)); break; case "inverse": //x = Console.getStringInput("Please enter your number."); simpleOp.inv(op.currentNumber); break; case "invert": simpleOp.invert(op.currentNumber); break; // default: // System.out.println("You have not provided valid input. Please enter \"?\" for a list of commands."); // break; case "x rooted": break; case "log": break; case "ln": break; case "log (change of base)": break; case "sin": break; case "cos": break; case "tan": break; case "inverse of sin": break; case "inverse of cos": break; case "inverse of tan": break; } } }