Thursday, November 10, 2005

This weeks VBA challenge

Don't worry, we will be spending nearly all day working on our projects on Friday, but just to get us warmed up, here's our weekly VBA challenge!

Finally, you're going to create your own game, based on the vba warmups from the last few weeks! We will need to work together on this one, as it's a bit harder than the previous weeks!

Create a Sub called GuessingGame. Our sub will do the following:
  1. Create a new random number between 0 and 100.
  2. Ask the user to enter a number.
  3. If the user guessed your number correctly, you should use a MsgBox to say "Congratulations!"
  4. If the user's guess is higher than your number, your program will respond with a MsgBox saying "Too high", or if it's lower, "Too low"
Once we've got that working, we'll modify our sub with a loop so that our game will keep on asking you to guess the number as long as you don't get it right!

0 Comments:

Post a Comment

<< Home