Purpose

1.You can use the InputBox ( ) function to generate an input box (a pop-up window) which provides a simple way to ask the user to enter data without placing a TextBox control on a form.

2.It is important that your program performs input validation on the values entered by the user. In Chapter 3 you learned that an exception will occur if you try to convert the contents of a TextBox to a number, but the TextBox contains nonnumeric data. We introduced the Try-Catch statement to handle those exceptions. In this lab you are required to use a new validation technique: Use the TryParse method and the If ... Then ... Else statement to prevent data conversion exceptions.

3.A repetition structure (loop) causes one or more statements to repeat a certain number of times. In this lab you are required to use the the following two types of loops to enter a number of scores.

Task 1: Use the Do Until Loop
Task 2: use the For ... Next Loop (you may add a ListBox to display each score)

Lab Description (Problem requirement)

In this lab, you will use an input box and a loop to enter a number of test scores. The scores will be added to a total and then calculate and display the average.

The application's form and the input box may look like the following figures. see image.

Lab Requirement

  • Read Textbook: Section 4.9 Introduction to Input Validation
  • Use the InputBox ( ) function to generate an input box ( a pop-up window) for asking the user to enter data.
  • Use the TryParse method and the If ... Then ... Else statement to prevent data conversion exceptions.
  • Task 1: Use the Do Until Loop for the repetition structure (Refer to Tutorial 5-6). Copy and paste your flowchart, source code, and output in this word document.
  • Task 2: After your program has worked, replace the Do Until Loop with the For ... Next Loop. Do you get the same result? Copy and paste your flowchart, source code in this word document.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.