Index
 Syllabus
 Announcements
 Schedule
 Assignments
 Exams
 Resources

Assignment 6

Due: Monday, June 7

Objective: Work with Javascript functions, HTML forms, and conditional statements.

  1. Modify the taxes.html page from the class examples as follows. Instead of using a flat tax rate, your new program should apply a variable tax rate. Specifically, if, after the itemized deductions, the taxable income is less than $20,000, the tax rate should be 10%. If taxable income is between $20K and $75K, the tax rate should be 15%. Otherwise, the tax rate should be 20%. You  must use conditional statements in your new program to account for the variable tax rate. Also, instead of using the Javascript prompt function, your program should be modified to receive input from two text boxes (income and deductions) as part of a form, and output the result into a third textbox after a button called "Calculate Tax" is clicked.
     
  2. Modify your grades.html file from Assignment 5 as follows. First, use HTML form elements to allow the user to enter the scores for the various components (homework, lab, midterm, and final) via textboxes. You should also have a button called "Calculate Grade". When this button is clicked two outputs will appear in two different textboxes. One will contain the computed weighted average (using the formula from Assignment 5). The second will contain a letter grade (A through F). A weighted average of 90 or above will result in a grade of A, 80 and above in a B, 70 and above in a C, 60 and above in a D, and otherwise in an F. In your JavaScript program, you should have separate functions for computing the weighted average (given the values for individual components of the grade), and for computing the letter grade (given the value for the weighted average). Here is an example of what your page should look like. [Extra Credit:] Organize your form elements and their text labels as cells in a table so that your page is better organized.
     
  3. Create a Web page, museum.html, that calculates admission cost for a single entry to a museum. Your form should have the following elements:
  • A radio button asking if they are a senior citizen (65 or over)
  • A select box asking if they are visiting only the regular exhibition ($10) or if they also want to
  • visit the special exhibition ($15)
  • A checkbox asking if they are a member, affiliate, or non-member
  • A button to calculate the entrance fee
  • A text box to output the calculated fee

The entry to museum costs $10 for regular admission, or $15 if they wish to also view the "special" exhibit. A senior citizen gets a $5 discount. A member of the museum, geta an additional 10% off. while an affiliate gets 5% off. For example, a senior citizen wishing to view the special exhibition and is also a member of the museum should be charged $15 - $5 = $10. Then take an additional 10% off, so their entry fee is $9.00.  [Extra Credit:] Organize your form elements and their text labels as cells in a table so that your page is better organized.
 

What to Submit

For each of the above exercises, you will need to create a Web page containing your Javascript code (and, of course, your HTML code for the page) similar to the examples discussed in class. You need to upload all of these pages to your Web space on students.depaul.edu.

Before uploading the pages to the server, test your page on your local computer to make sure everything works and looks as intended. On your student Web space (inside the public_html folder), navigate to the it130 Folder and create a new subfolder called hw6. Using SSH upload the pages you have created and any associated files to this folder on the server, set their permissions for the files and folders, and check them with your browser.  The link to submit should look something line the following:

http://students.depaul.edu/~yourlogin/it130/hw6/

Important: set the permission for the folder hw6 so that it is readable by all users (public). This will allow the contents of the folder (your pages for the above exercises) to be listed as links.

Submit this URL via Course Online (type the URL into the comment box).

Please see the syllabus for the policy on late assignments.


Back to Assignments