BIS 311 DeVry Week 4 I Lab

Downloading is very simple, you can download this Course here:


Contact us at:



BIS 311 DeVry Week 4 iLab


BIS 311 DeVry Week 4 iLab



In this lab, you will implement a grade calculator application that meets the following business requirements:

Grade Calculator Business Requirements

The user types the number of grades he or she wishes to enter in a text box. When the user clicks a button, the application enters a loop that accepts the specified number of grades and totals them up. The application then displays the entered grades and their average, formatted to two decimal places.

Grade Calculator TOE Chart

Task Object Event
Get the following inputs from the user:    
Number of grades to enter txtNumGrades  
Each grade Input box  
Perform the following processing: btnCalcAvgGrade Click
Add up the total of all grades    
Divide the total by the number of grades to calculate the average    
Display the following outputs:    
Each grade txtGrades  
Average grade formatted with two decimal places lblAverage  


Pseudocode for Grade Calculator Application


Declare numeric constant for Maximum number of grades =100

Declare numeric variables for:

Number of grades


Total of grades (initialize to 0)

Average grade

Declare numeric array GradeArray able to hold the Maximum number of grades

Get the Number of grades

Repeat for each grade up to Number of grades

Get the Grade

Store the Grade in the GradeArray array

Add the Grade to the Total of grades

End Repeat

Calculate Average grade =Total of grades/Number of grades

Repeat for each GradeArray element up to Number of grades

Display the GradeArray element

End Repeat

Display the Average grade formatted with two decimal places



Submit a Word document named Lab4YourFirstLastName.docx (where YourFirstLastName = your first and last name; e.g., Lab4JohnSmith.docx) containing the following:

  • Screenshot of form showing the application running, with 10 grades entered and displayed along with the correct average.
  • Copy of button-click event code


Step 2: Rename Form and Add Controls”>Back to Top

(a) In the Solution Explorer pane on the right side of the screen, right-click on Form1.vb, select Rename, and change the name to GradeCalculator.vb. Press Enter after entering the new form name.

(b) Change the Text property of the form to Lab 4 Your Name (where Your Name = your full name), as you have done in previous labs.

(c) Drag the following controls from the ToolBox onto the form, arrange them in logical fashion, and set their properties as indicated in the table below:

Control Name Property Text Property Multiline Property ScrollBars Property ReadOnly
Label Label1 Enter number of grades:      
TextBox txtNumGrades        
Button btnCalcAvgGrade Get Grades and Calculate Average      
Label Label2 Grades entered:      
TextBox txtGrades   True Vertical True
Label lblAverage Average will display here      

(d) Ensure that all controls are positioned and sized so that the form has a neat, professional appearance and none of the text is cut off. Your completed form should look similar to the following.

Step 3: Code Button-Click Event”>Back to Top

(a) Double-click the button on the form to open the code editor with a template for the button-click event procedure.

(b) Starting where the cursor is positioned, in between the line beginning Private Sub btnCalcAvgGrade_Click( . . . and the line End Sub, enter the following code.

Code for Button-Click Event

‘Get grades and calculate average

‘Declare constants and variables

Const intMAX_NUM_GRADES As Integer = 100

Dim intNumGrades As Integer

Dim intGrade As Integer

Dim intTotal As Integer = 0

Dim dblAverage As Double

Dim intGradeArray(intMAX_NUM_GRADES – 1) As Integer

‘Get the number of grades

Integer.TryParse(txtNumGrades.Text, intNumGrades)

‘Loop to accept grades and add up total

For intGradeNumber As Integer = 1 To intNumGrades

Integer.TryParse(InputBox(“Enter grade #” & intGradeNumber), intGrade)

intGradeArray(intGradeNumber – 1) = intGrade

intTotal += intGrade

Next intGradeNumber

‘Calculate average grade

dblAverage = intTotal / intNumGrades

‘Loop to display each grade entered

For intGradeNumber As Integer = 1 To intNumGrades

txtGrades.Text += “Grade #” & intGradeNumber & ” = ” & intGradeArray(intGradeNumber – 1) & vbCrLf

Next intGradeNumber

‘Display average

lblAverage.Text = “The average grade is ” & Format(dblAverage, “Standard”)

The code editor window should look like the following after you have entered your code.

Step 4: Test, Debug, and Submit”>Back to Top

(a) Run the application by doing one of the following: click the Start button; pull down the Debug menu and select Start Debugging; or press the F5 key.

(b) Your form should appear. Test your application by entering the value 10 as the number of grades and clicking the Start button. An input box should appear, prompting you to enter a grade. Enter the first grade from the list of test data below and click the OK button in the input box. Continue entering the test grades, clicking OK after each one, until all grades have been entered.

Grade # Grade
1 60
2 93
3 89
4 61
5 60
6 70
7 85
8 76
9 76
10 92


During the grade entry process, your screen should look like the following.

(c) After you enter the last grade, the application should display all the grades and the average. Your screen should look as follows:

(d) If you receive an error message or your application does not work correctly, debug the application and try again. Post in the Q & A Forum or contact your professor for assistance if needed.

(e) When your application works correctly, capture a screenshot of the form showing the 10 grades entered and the average, and paste it into a Word document. Remember, use CTRL+ALT+PrintScreen to capture a screenshot. Also select and copy your button-click event code and paste it into the Word document. Save the Word document asLab4YourFirstLastName.docx (where YourFirstLastName = your first and last name; e.g., JohnSmith) and submit it to the appropriate dropbox.