CX 103 : Introduction to Computers

Spring 2001

Assignment  14
Due: Monday, March 19
 

 
Reading

 Begin reading Chapter 9: "JavaScript/JScript: Control Structures I" in  Deitel, Deitel & Nieto, Internet & World Wide Web: How to Program.
 
 

Programming

 
 1) Write a JavaScript program that inputs from the user three integers and then displays the integers, their sum, product and average. The program should conclude by identifying the largest of the three integers submitted by the user.
 To test your program, try different combinations of integers. You will need to do at least three runs of the program: one for each of the cases that the largest integer is the first one submitted, the second one submitted, and the third one submitted. Try to write the program so that it is relatively efficient in the number of comparisons it makes.

 2) Write a JavaScript program that inputs from the user six uppercase letters  and then displays the letters and the number of vowels and consonants submitted. Count as vowels  A, E, I, O and U and count all other letters as consonants.
  You may assume that the user will only enter genuine upper case letters and will not try to trick you by entering a lower case letter or a character (such as %) which is not a letter of the alphabet. Comment on how you might approach the issues of converting a lower case letter to an upper case equivalent and of rejecting a non-letter character.

 

Longer Term Creative Project

 Put together all the HTML features we have studied to produce your personal home page for your web site. Complete this project by Friday, March 23.