//** * Write a description of class XTester here. * * @author (your name) * @version (a version number or a date) */ public class XTester { // instance variables - replace the example below with your own /** * Constructor for objects of class Tester */ public XTester() { // default constructor (only) } public static void main(String[] args){ System.out.print("slightly modified main method from SimpleCalc exercise"); Scanner scanner = new Scanner(System.in); while(true){ // calculate for ever, and ever, and ever. System.out.print("Enter arg #1: "); int arg1 = Integer.parseInt(inputStr); System.out.print("Enter operator (+,-,*,/,%,^,!,prime?,quit): "); String op = scanner.next().trim(); String opResStr = ""; if (op.equals("quit") || arg1 == 0) // time to say goodbye break; System.out.print("Enter arg #2: "); int arg2 = Integer.parseInt(inputStr); System.out.print("we would call handleBinaryOp(op, arg1, arg2) here"); else opResStr = String.format("Invalid operator '%s'", op); System.out.printf("%s\n-----------------------------------\n\n", opResStr); } System.out.print("Goodbye!"); } } }