LIS 7008 - Information Technologies
Summer 2014 - Section 01
Assignment 6


This homework is due on your course Web site before the beginning of the next class session. Partial credit may be awarded. If you do not have any previous programming experience, it may take you long time to learn and you may feel frustrated. So we have a special grading policy for this assignment. If your program works, you earn 100 points; if it partially works, you may earn a grade between 80-95; if you have done some meaningful work but it does not work at all, do not sweat, I will take a look at your program and assign a grade between 60-79. If you do nothing, that is 0, but it would be appreciated if you could tell me that you did not do anything because it takes time for me to figure out what you have done. The purpose of the assignment is to give you the opportunity to learn how JavaScript can be used to create an interactive Web page, not to train you to be a good JavaScript programmer. If you are serious about being a Web designer, you are advised to take LIS 7510 Website Design and Management, in which Dr. Ju will teach you a whole lot of JavaScript. It is not realistic to train a social scientist or a humanity scholar to be a JavaScript programmer in one class session if she/he has no previous programming experience.

Explanation

The JavaScript program that we looked at in the lecture notes (i.e., selector.html) is a good start, but a real search tool selector would probably need to provide more options and do more sophisticated selection. It is therefore important that you learn how to modify JavaScript that you find on the Web to suit your purposes. In this assignment, you will modify selector.html in two ways, and post your modified page on your Web site for the instructor to grade.

If you have not downloaded the page, please do so here: shorthand version or full version (with semicolons and complete braces)

What the program does

The purpose of the program is to direct users to a Web Search Engine and a Web Directory based on the user's age. If the user is an adult (age >17 and <120), direct her to www.yahoo.com if she wants a Web Search Engine, or to dir.yahoo.com if she wants a Web Directory. If the user is a kid (age ≤17 and >0), direct her to www.askkids.com if she wants a Web Search Engine, or to kids.usa.gov if she wants a Web directory.

Your Task: Modify the Program

Task 1. The library board has decided that people aged 16 and over should be treated as adults by the search tool selector. Change your copy of the page to implement this new policy.

Task 2. Your library director has learned that a recent report published in the Journal of Internet Stuff has revealed that people over 40 prefer the Yahoo! search engine (http://www.yahoo.com), but that adults aged 40 and under prefer Google (www.google.com). Change your copy of the page to send adults to the search engine that they are most likely to like based on their age (if they select a search engine).

Save your work as hw6.html (or whatever filename you like), then link this from your 7008.html Web page you created for HW4.

Testing

Please be careful when using age to specify a population group, for instance, age>16 means "17 and up".

Here are the age specifications and expected results:

You can (and I will) use the following age values to test your program to get the expected results:

Age Expected Seach Engine Expected Web Directory
10 ask kids kids.usa.gov
16, 17, 40 Google dir.yahoo
41, 50 Yahoo! dir.yahoo
120 Invalid age 120 Invalid age 120

Common problems and solutions:

Grading rubric:

Grade Program
0 Program is not posted on your course Website before the due time.
80 Only Task 1 is finished.
85 Efforts were made to finish Task 2, but program does not work.
90 Program does not work, but you are almost there.
99 Program has very minor errors.
E.g., if age==40, user should be directed to Google rather than Alta Vista.
100 Program's behavior meets specification.

These are the most common categories. You can actually grade your work by yourself.


Acknowledgement to Doug Oard, revised by Yejun Wu.