BIT 116 - Scripting
Assignment 2

Due: Thursday, January 25th 

A Personalized Table Generated from User Input


This is another web page whose content is provided by the user via prompt() and confirm() boxes. This time, the page being created is an address book. The information provided by the user is the names, addresses, telephone numbers, email addresses, and children's names of their relatives, friends, and contacts. Your page will use this information to generate an html table that displays a personalized address book for the user.

Here is a sample of what the output of the page could look like:

Name Address Telephone Number Email Address Children's Names
John Doe 1 Elm Street
Seattle, WA
98000
(206) 111-1111 john.doe@whereever.net
  • Robert
  • Sally
Sally Smith 15th Ave NE
Bellevue, WA
98999
(425) 222-2222 sally.smith@something.com None

You are free to format the table to your own tastes, but it should display the appropriate information provided by the user.

Here is the sequence of events that the user goes through when using this page:

  1. The user is asked whether or not they'd like to add a name to the address book.

    If the user wants to add a name to the book, proceed to step 2. If the user doesn't want to add a name to the book, proceed to step 4.
     

  2. The user is asked to provide the name, address, telephone number, email address, and all of the children's names of the next entry in the book.

    Note: The user is not allowed to add duplicate names.  You may match exactly (so that John DOE is considered to be different from John Doe), or in a case-insensitive manner (so that John DOE is considered to be the same as John Doe)
        Hint: You should use an array for this

    Note: When entering the children's names, the user is first asked how many children there are for this contact, and then they are asked to enter each name in its own prompt() box.
     

  3. Return to step 1.
     

  4. The address book containing all of the information provided by the user is displayed to the page. 

The key to this assignment is that you will not know how many names the user plans to enter when you are writing this script.

Restrictions and Requirements:

What to hand in:

  1. Your A2_Contacts.html file.  You are not provided with a starting HTML template - you will have to make your own.
    Make sure to place the program title, A2.0, into the <title> tag in the <head> of your document for each assignment. Follow it with a “ : ” and your full name. Example: <title>A2.0: Ian Bansenauer </title>
    This is a required part of each submission!
  2. The separate .JS file that contains your JavaScript code.  As long as there's just one extra file it will be clear that you want me to grade that one, so you can name it whatever you want.

How To Hand In Your Homework:

We will cover this in class, on the date that this assignment is due.