Lab 4 - Calculating Methods with Integers
Due: Monday, September 25 @ 11:59 pm


For this lab, you should implement a calculator with a few extra functions (and minus a few others). You should have a small user interface (UI) on the command line and be able to calculate multiply, divide, exponent and the remainder of a division. NOTE: To make this a little more fun, you should implement this without using * or /. This means that you can only use + or -. This lab should assume that every number in the universe that will be entered into it is positive or 0.

The Math Library

Please write a short program that implements the following functions:

What they should do:

The User Interface

Your program should also implement a small user interface, which will ask the user what they want to do - multiply, divide, calculate an exponent, calculate a remainder, or quit. We recommend the use of a loop. Who knows, someone might decide to use our calculator to calculate exponents all night!

Don't forget to include your name, section, the date, this lab number, and your favorite flavor of cheese in a commented out section at the top. /* like this, remember? */ If you wished to comment your code as well, to tell someone who looks at your code what it does, feel free to do so. We always like that.