Assignment: Calculator Program
Code a calculator (like the one in the Accessories Menu).
The order to code your program:
design and code user interface.
build a number when the buttons are pressed (eg can you press the buttons to get 345?)
build two numbers with a sign in the middle, and evaluate them. (eg 34+34)
code equals
code clear
build in some other buttons.
Calculator Marking Rubric
Functionality
|
/40 |
Buttons
Available |
Many Additional Buttons added. Error checking. |
An additional button to /, *, +, -. Well documented. |
Does these functions: /, *, +, -. |
Major errors in the program. |
|
Equations
it can evaluate |
Can do all of previous levels and some of: ·
Exponents ·
Squaring ·
Memory keys ·
Scientific notation ·
Decimal key ·
Sin/cos etc. |
Can do: ·
22+33+44= ·
45-21/33= (no bedmas) + other function(s) (see level 4). |
Can do: ·
2+3= ·
22+55= ·
45-22= ·
67*2= ·
58/12= |
Can do one or two of level 2’s questions |
Style
|
/10 |
Efficiency |
Functions are fully utilized to reduce the amount of repeated code.
Very efficient code. |
Some functions to reduce the repeated code. Fairly efficient code. |
Few to no functions. Code is inefficient in places. |
No functions. A lot of repetition and inefficiency. |
|
Comments |
Comments are elegantly written. Pre and post conditions are well
handled. |
Comments explain program sufficiently. Pre and Post conditions
attempted. |
Comments are present before majors ifs and loops. |
Too few comments. Pre and post conditions needed. |
|
|
Code
Structure |
White space and tabbing is used expertly to format code. |
White space and tabbing is used in the code. |
Code is hard to read in sections because of missing white space or
tabbing. |
Code appears messy. It is very hard to read. |