In this assignment, you'll design & implement a multi-function calculator that runs in a browser. The primary objectives of the assignment are:
Please read the following very carefully. Any calculator that materially deviates from these requirements will not be graded and will receive a grade of zero. Examples include, but are not limited to, calculators that operate like commercial calculators (e.g., numeric keypad), or implemented with JavaScript functions. The only JavaScript function that you may use is the parseFloat() function. You MAY NOT use any other functions! If you are in doubt, its your responsiblity to ask me before submitting your assignment.
Your calculator must contain the following features:
Two textfields for operand input and one textfield that displays the result of an operation. Use an appropriate label for each field.
A button for each of the following operations:
Each button is labeled with the appropriate JavaScript operator syntax (e.g., +, <=, !=, etc.).
The user enters two inputs and clicks a button. The output displays the entire expression in the following format:
For example, if inputs are 3 and 4, and operation selected is == (equals),
the output must be 3 == 4 is false. For the same inputs where the operation
is % (modulus),the output must be 3 % 4 = 3. For all relational operations, use ' is ', and for all arithmetic operations use ' = '.
No specific layout of the calculator is required. You are expected to develop a sensible, user-friendly layout. Whenever a user clicks within an input field, it should reset so the user doesn't have to erase any values.
You are permitted to use HTML/JavaScript code from the following sources:
Here is a version of the Simple GUI calculator that properly converts string input to a decimal number that can be mathematically manipulated. It uses the parseFloat(String input) method. Use it for all calculator functions. All other functions are prohibited. I suggest you study the example programs referenced in the powerpoint slides for Chp. 19.
You will add the following resources to your website:
You must submit your entire website as a zip file ('LastNameWeb.zip') via the assignment feature in courseWeb. No other submissions will be graded. The completed assignment is due by 10 pm Friday February 24th. After that deadline, it is deemed late without penalty and may be submitted until 10 pm, Sunday February 26th. No assignment submitted after that deadline will be graded and a zero will be assigned. BONUS!! If you submit your assignment before 10 pm Wednesday, February 22nd and your grade is no less than 90, 7.5 bonus points will be added to your grade!
You must use a text editor to compose your pages. No HTML generation tools are permitted (that includes MS Word). If your pages contain any tags generated by a tool, 25 points will be deducted from your grade.
This assignment is worth 8 points out of 30 total homework points.