Question: Use Visual Basic to create this assignment . Pay attention to #13 for submitting your project. Summary : In this assignment you create a program

Use Visual Basic to create this assignment. Pay attention to #13 for submitting your project.

Summary: In this assignment you create a program to generate 21 random numbers, display them in a List Box, find Minimum, Maximum, Total and Average and display them in Label controls.

Input data:

  • Random numbers will be generated

Instructions:

  1. Create a new project and name it as yourlastname-firstname-Assignment6. Save this project in VB folder you created earlier.
  2. Change forms title to: Your full name Assignment 6 - Random Numbers.
  3. Form contains nine Labels, one List Box, and three Button controls.
  4. Use List Box to display random number (make sure List Box is tall enough to display all numbers), labels to identify Random Numbers, Maximum, Minimum, Total and Average. And display the corresponding data for Maximum, Minimum, Total and Average. See below Form Layout with Controls for more details. Note: When naming controls, make sure you follow controls' naming convention we have learned in this class.
  5. How to generate random numbers in VB?

    First declare a random object

    Dim objRandObject As New Random ' Need to create a "random object" first

    To create a random number within range of 0-99, write:

    intRandNum = objRandObject.Next(100)

    Declare an array of uppersubscript of 20.

    Fill the array with random numbers. Do not sort the array.

  6. How to find maximum, minimum total and average? See Arrays slides.

- Input variables: None

- Computational variables:

  • You need to create a Random Object first: objRandObject As New Random
  • intNumbers(20)
  • intRandNum
  • intCount

- Output variables:

  • intMax
  • intMin
  • intTotal
  • intAverage
  1. Items to note:
  2. Variables names must follow the conventions and rules explained earlier and must have proper data type for the values that will be stored in them.
  3. Appearance of the form is very important; Make sure that your design is clean; Spelling is important.
  4. Fill And Computer button, generates 21 random numbers, displays them in the List Box, finds Maximum, Minimum, Total and Average and displays them.
  5. Clear button, clears List Box and four Label controls on the right side. Before generating random numbers, clear the List Box of any possible previous data.
  6. Exit button, closes the Form.
  7. You will write the code for the three buttons.
  8. Avoid double-clicking on List Box and Label Controls to create unnecessary code. If you do, please delete them.
  9. Run the program, click Fill And Computer button to display 21 random numbers in List Box, Maximum, Minimum, Total and Average of these numbers. See example for the complete program below.
  10. To save the project, from File, select Save All.
  11. Continue with SaveAll after making changes.
  12. Once project is complete, open File Explorer; open VB folder and you will see a folder named: yourlastname-firstname-Assignment6. This folder contains a folder and a solution file with SLN extension. Both are named the same. Solution file (.SLN) and the folder containing VB necessary files to run the project.
  13. To receive credit for this assignment, create a zip file named Yourlastname-firstname-Assignment6.ZIP. Submit this ZIP file in Assignment 6. Only ONE file, please. See SubmittingAssignments for creating a zip file.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!