Homework Assignment 3

 MCS 170: The Nature of Computer Science

Due: Friday, September 22, at the beginning of class

  1. #3, 4, 5, 6, 8, 9, 13, 15, 22, and 23 on pages 56-57

  2. Create an HTML page that has a Javascript section with document.write statements to achieve the same effect as is shown in the following rendered HTML:

    Some text in italics and some in bold
    and some more underlined.

  3. Create an HTML page that has a Javascript section that uses the prompt statement to ask the user for his/her favorite cartoon character (stored as the variable "name") and then greet the user by saying "Hello name". 

  4. In JavaScript (and other programming languages) when a variable is assigned a value, that value overwrites any previous value of the variable. To illustrate this, create an HTML page that assigns a value to a variable and then replaces this value with a new value.  To accomplish this, create a page that (1) declares a variable message, (2) assigns message an initial value, (3) displays the initial value of message, (4) assigns a new value to message, and (5) displays this new value. The output from your page may look something like the following:
The initial value of message is "MC170"
The new value of message is "LunchTime!"

 For the previous three exercises, either hand in a hard copy of your completed HTML pages or mail your html files to sskulrat@gac.edu.