| |
Unit 3 Lesson 5
Exercise 1
- Create a new form with the name Randoms.
- Create the form as shown below. When the button is clicked a random number between 10
and 60 is generated. A message box will appear with the information icon and only the OK
button and the message Random number #, is: #. So the first message box might
display the message Random number 1, is: 42.
- This will continue until five message boxes have displayed 5 random numbers. When done
the first output label will display the five numbers separated with commas and a space.
The last number will not have a comma after it.
- A second output label will display the sum of the random numbers.
Exercise 2
- Create a new form with the name Login.
- Create the form as shown below. Set your name as the User Name. Set the password as DSC.
If the correct entry is made, display a message box that tells them they are a valid user.
- If they are a user, but the password is incorrect, an input box informs them to enter
their password only. They are only given three chances to type the password.
- If on the fourth try it is not correct, a message box appears telling them that the
network police are after them! If correct, tell them they are a valid user.
- If the User Name is incorrect, let them enter it once, and give them three tries to get
the password correct as in the previous statement.
|