CISC Homework H02
Introduction
In this assignment, you will continue adding functionality to your currency conversion web application.
You will use the currency code you have been assigned (e.g. USD, EURO), and convert from that currency to another currency.
Here are a few things that you will need to complete this assignment:
- A working version of the web application you created for H01
- Knowledge about basic
for
loops and if
statements
- Knowledge about DOM objects in web forms. A good reference includes:
- Knowledge about elements and attributes for the elements that you will use
Overview
In this assignment, you will:
- Add conversion functionality to your web application using only
for
loops for your conversion method
- Dynamically output the results of the conversion into your web application
Step-by-Step Instructions
Step 1: Reading
Yes... More Reading. Read the book (if you haven't already) and really understand control structures.
Step 2: Review and study the holes in the code to get familair for what the assignment is asking you to do.
Pay special attention to the converter.js
file again and how the code calls the conversion and output functions.
Step 3: Proceed with filling in the code in the web page at the locations marked by the indicators below.
-
*1* — You should enter the function call for
convertCurrency()
JavaScript function using
the correct input
attribute for your button.
Step 4: Proceed with filling in the JavaScript code in the converter.js file marked by the indicators below
-
*1* — Fill in
convertCurrency()
.
Hints:
- You will need to obtain the correct elements from the web application to work with.
- You MUST use a
for
loop for your currency conversions. You may only use multiplication
for any value that is the decimal part of the currency.
- With that said, it is a good idea to use basic math to split the input currency into a unit part and
a decimal part (i.e. unit.decimal)
-
*2* — Fill in the
writeAnswer()
function.
Hints:
- Do not worry about decimal places for right now. This assignment just concerns producing meaninful output.
- You MUST create a meaninful sentence for your output. (i.e. Refrain from simply regurgitating the converted answer
Submission
Zip all of your files in a .zip
file and submit your file on
WebCT.
Grading Rubric (80 pts total)
Item |
Description |
Points |
Correct calling of the
convertCurrency() function |
Refer to above references for specification |
10 |
JavaScript code |
Your Java code works and is well commented and structured |
50 |
User Friendliness of the Output |
Be Creative. |
10 |
Scripting and Submitting |
You followed instructions for submitting |
10 |
TOTAL POINTS |
|
|
Due Date: TBA