Summer
Institute For The GiftedClasses taught by Maureen L Greenbaum Drew University June 30 - July 20, 2002 |
| Concepts |
|
|
Methods alert |
Say Hello: Using alert tell the world Hello |
| prompt | Ask: Using prompt and alter, get your name and then say Hello to yourself. |
| writeln | writeln Using prompt and write, get your name and then say Hello to yourself. Remember to put <br> at end of line |
|
math parseInt function |
Sum:
Using prompt and write, get 2 numbers and print their sum. subtract: Using prompt and write, get 2 numbers and print their difference. multiply: Using prompt and write, get 3 numbers and print their product. average Using prompt and write (or alert) , get 3 numbers and print their average. |
|
if/case toUpperCase |
State capital:
Make a page with either maps or pictures of famous places that identify
a state. (use the ClipArt Gallery or search the web). Make it a
hyperlink and use onClick event to invoke a function that requests the state
name and tests if the answer is correct (use toUpperCase method to permit
upper and lower case). The if the answer is correct, request the capital
or state bird or whatever (use
for data). Try as an array when you
have 50 to do! |
|
Case Date date methods |
Good Morning: Using the system date, say "Good Morning", "Good Afternoon or Good Evening" to yourself upon loading your page. Hints. First make a date object, then extract the hour using the getHours method. Then use IF or switch/case too test if it is after midnight but before noon, afternoon but before dinner (7pm which is 19 army time) solution |
| for |
Growing
Text: Render text with ascending
font sizes (from font size 1 to 7), starting over when it hits 7. |
|
case while |
Pass/Fail count:
Enter numeric student grades until an negative grade is entered. Count
the number of pass grades and failures (60 or over pass). Dietel, Dietel, Nieto Internet& World Wide Web-How to Program, p308Hint: Create the prompt then if for one student first, them put in a while or do/while loop |
|
case while
|
Grades: Using case count the A's (90 or more), B's (80 to 89), C's,
D's and F's (59 and under)
|
| case array |
Day of the Week: using date and getDay method print out the day of the week. Try if first using a switch/case then try putting the days of the week into an array and printing the correct array. case solution array solution |
| onLoad onUnload |
When a visitor leaves your site, alert them how long they have been viewing the page. |
| input function |
solution |
| onmouseOver onMouseOut Window.status |
Helpful Message: Display a helpful message on the status bar when the mouse hovers over a hyperlink. Display a different one when the cursor exits. explanation |
| onload onunload onblur |
|
| Images | see the birdie change size. Now do it with a MouseOver and MouseOut. And try continually using a setTimeout(). |
| Images Array |
see the joggerer run. use the individual pictures |
| Images array if |
see the rocking horse.use the individual pictures |
| setTimeout clearTimeout getHours getMinutes getSeconds value property |
Clock: Create a clock that displays
the time Hints: set a time onLoad, clear it on onUnload. Create a date/time object that contains the system date/time. Extract the houses, minutes and seconds using getHours, getMinutes, getSeconds. Concatenate them into a variable with some ":" separating the pieces. Display it by setting the value of a input text box. solution also works |
| String Object Methods bold() italics() fontcolor() fontsize() substring() subst() |
Hints: substring() |
Site creation and maintenance by Maureen Greenbaum of Sumware in NJ
This page last modified May 03, 2008
©1997, 98, 99, 2000, 01, 02, 03, 04, 05, 06, 07, 2008 SUMWARE in NJ, Watchung, NJ