O.P. Web Geek Contest - W/ Prize
Create a Secret Number Guessing Game Program
1. Write Pseudocode for a JavaScript program that does the followin
• Declares a random secret number between 1 and 10.
• Allows the user to try and guess the secret number. They are allowed as many guesses as they need to get it right.
• Help them along by outputting information after each guess.
o If their guess is too low, out put that “ (number they guessed) is too low. Please try again.”
o If their guess is too high, output that “(number they quessed is too high. Please try again.”
o If their guess is correct, output “You guessed it!”
2. Now write the JavaScript Program using your pseudocode as a guide.
You have not yet learned how to generate random numbers so here is the code to declare a variable and then to generate a random number between 1 and 10 and assign it to the variable.
var randomValue;
randomValue = Math.floor (1 + Math.random () * 10);
note:
• you must use the proper lettercase - M must be a capital letter or you will get logic errors
• you will need to use the if / else selection structure and you will also need to use the while repetition structure in this program.
------------
Prize:
All of the below
craftytv.com invite
30mb.com invite
gmail invite
web2messenger invite
webdp invite
How to win
Be the first to answer the correct code
![[Image: glennlopez.png]](http://dxlabs.skarz.co.uk/wdp/dynamic/wlmblack/glennlopez.png)
Click the image above to send me a message on MSN messenger via web browser.
|