**Due Date:** Monday, February 19, or Tuesday, February 20, 2007,
before the beginning of your lab section.

**Objective:** The main objective of this assignment is to practice
using conditional statements.

**Programming assignment:** use JOptionPane to design a simple
calculator. This calculator should read simple expressions describing
operations on positive integers, like 15+5 or 3*41, and generate
the result of the corresponding arithmetic operation (or an error
message if the user accidentally types in something like 1/0). For
simplicity, feel free to assume that the expressions do not have blank
spaces (but please inform the user about this restriction in the
input prompt).

**Hints:** You already know all the tricks that you need to build such
a calculator:

- you know how to set up an input message box and how to read from such box -- we had that in Programming Assignment 3;
- you know how to check whether a given string contains a given symbol such as +, -, *, or / -- we had that in class; specifically, if the string contains the symbol, the corresponding operation returns the location of this symbol, otherwise it returns -1;
- you know how to separate a part of the string before the symbol and a part after the symbol;
- you know how to translate strings into integers -- we learned that when we learned how to read an integer from the GUI;
- you know how to implement arithmetic operations with integers;
- you know how to return the result -- and, if necessary, how to set up an error message box.

**Homework assignment:** on a separate sheet of paper, solve Ex. 10
from p. 218 and Ex. 12 from p. 219.

**Deliverables:** as instructed by your TA.