597 Assignment 3: Calculator
Fall 2007, David Matuszek
Your calculator should look like this:
The calculator should work exactly like a "real" calculator, of the sort you can usually buy for under $5.
The buttons at the top have these meanings:
Taking the square root of a negative number should yield
the display, and disallow any further work until
The number returned can be used just as if the user simply entered it using
the calculator buttons.
Clears the current entry, but does not clear any pending operation. For example,
Clears everything--the display, any pending operator and operand, and any error.
Event handlers on calculator buttons should only call functions defined in
<head> element; they shouldn't do any work of their
You can play around with shapes and colors and button arrangement, in order to give the calculator a more pleasing appearance, but I want exactly these buttons with exactly these meanings.