Provide a brief definition of the following terms (in the interface
programming context):
Comparison Operator
Logical Operator
Precedence
Boolean
Condition
Reserved Word
If you use a source (book or web site), cite your source. (The sites
http://whatis.techtarget.com/ and http://www.webopedia.com/ are decent
sources for technical definitions.) The section on if's is in
Chpater 3 of Beginning JavaScript (Wilton and McPeak).
Answered some questions about homework due (tip calculator). If you were getting concatenation where you wanted
addition, remember the functions parseInt() and parseFloat(). See links above.
MathOddity_3.htm. Started if's. Handled the situation if the user's input
was "not a number", was negative, and was not a three-digit number. Also worked with the text input's onkeydown event to
make changes when user types in a textbox.
Tip calculator update. Update your tip calculator program so that
It displays the tip as well as the total (tip plus bill).
The tip and total are displayed as currency -- with a dollar sign
and two decimal places. See the ToFixed link above.
Results are cleared if the changes are made to either the bill amount
or the tip percent.
Prior to any calculation the bill amount entered by the user is tested
to see if it is actually a number and if it is positive. You must alert the user to the problem and
code at least one other response (e.g. clear text, place focus in text input, change font to red, etc.)
Class standing. Write a page that prompts a user to enter the number of credits he or she has
earned so far. The program should determine and display his or her class:
freshman 1-23 credits, sophomore 24-53 credits, junior 54-83 credits or senior 84
credits and up.
There are various ways to handle this problem. It can be handled using
if and return that we introduced yesterday. Another way to solve
it is using the if -- else-if -- else structure
http://www.w3schools.com/js/js_if_else.asp.
Yet another way uses if along with the
and (&&) logical operator.
http://www.w3schools.com/js/js_comparisons.asp.
If you have your Beginning JavaScript book, page 61 might be useful.
Posting a web page on the alpha.
Follow the instructions found in Posting.ppt
(PowerPoint).