Your instructor will assign one or more of the following problems. Submit all appropriate files for grading, including code files, screen captures, supplemental files (e.g., image files), and text files.

  1. For this assignment, extend the calculator you built in the lab to do the following:

    For example, if the user uses the calculator to compute “1” + “1”, and then computes “memory” + “3”, the answer should be 5 (i.e., the remembered value 2 plus 3). There are different ways to implement these features. Here is one way:

    Extra-credit: Implement the calculator so that the memory value is undefined at first. If the user tries to use the memory feature before performing a calculation, the Calculator class should throw an appropriate exception and the CalculatorController should handle that exception. Be sure to unit test this feature.

    Note that while the lab version of the calculator could have been implemented as a static library, this memory extension requires the use of instance variables and methods.