I have a CS lab due tomorrow and since I suck at javascript, it will be passed in incompleted. If there is an individual out there with time on their hands to give this lab a crack at, it would be appreciated. I just need the javascript code so I can copy and paste it into notepad to produce the result.
The output page should look something like this:
ANNOUNCING:
S
Sc
Sco
Scoo
Scoob
Scooby
Scooby!
Here are the lab instructions:
1. Write a program that prompts (uses the prompt function you saw in assignment 6) the
user for his/her name and announces that person. You will need to
use the length and substr( ) methods, as well as a for loop. Use length to count the number
of letters in the name, use the for loop to loop that number of times, and in each pass
through the loop, use the substr( ) method to produce the user’s name and then portions
thereof. You may use first name only or both first and last names.2. Modify the program created above to print every second line of the given name a
different colour. Make sure to use a light and a dark colour. Hint: use an if statement along
with the % (mod) operator and work with the iteration variable.3. Finally, modify your program in the following ways:
a. Place your program code for printing the name in a function called:
announceUser(userName)
b. Add an input box and a button
c. Call your function from the button’s event handler using the text in the
input box.
Hint:1. You will need to use the <FONT> tag creatively for step 2.