Assignment 5
Home Up

ASCII table

Unit 3 Lesson 5

Exercise 1

  1. Create a new form with the name Randoms.
  2. 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.
  3. 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.
  4. A second output label will display the sum of the random numbers.

wpe3.jpg (9425 bytes)

Exercise 2

  1. Create a new form with the name Login.
  2. 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.
  3. 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.
  4. 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.
  5. 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.

wpe4.jpg (8086 bytes)