You are on page 1of 6

Average Grade

Program Documentation
Submitted by: [replace this with your name]
Submitted to: [replace this with the name of your teacher]
Average Grade
Problem Definition

Create a program that will compute for the average of four


grades.

Program Description:
____________________________________________________________
____________________________________________________________
____________________________________________________________
____________________________________.

IPO Chart:

INPUT PROCESS OUTPUT

Algorithm:
1. Hierarchy Chart
User Interface design.

1. Form Design Specification


IPO IPO Value Control Properties Value
Components
Form Name frmU3L2Activity01
StartPosition CenterScreen
Text Average Grade

Input First

Second

Third

Fourth
IPO IPO Value Control Properties Value
Components

Process

Output Average

2. Event Planning Document

Project Name Developer Object Date


U3L2-Activity01 frmU3L2Activity01 7/30/2022

Object Trigger Event Processing


btnCompute Click  Get the grade for txtFirst, txtSecond,
txtThird, txtFourth
 Compute for the Average using the
following formula:
Average = (First + Second + Third +
Fourth)/4
 Display the Average
btnClear Click  Clear the contents of txtFirst
 Clear the contents of txtSecond
 Clear the contents of txtThird
 Clear the contents of txtFourth
 Clear the contents of txtAverage

3. Use Case Definition


a. The Average Grade window opens and display the
following components:
 Four textboxes labeled as__________________,
____________________, _________________, and
______________________ respectively. These
textboxes require the user to input the grades.
 A textbox labeled ____________. This textbox
serves as the container of the computed average.
 Two buttons labeled __________ and ____________.
b. The user enters the _________________.
c. The user clicks on the ____________ button.
d. The program displays the average grade.
e. The user may click on the _________ button to erase all
the data on the form.
f. The user clicks the Close button to terminate the
application.

Program Code
Public Class frmU3L2Activity01
Private Sub btnCompute_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnCompute.Click

Dim gr1 As Double


Dim gr2 As Double
Dim gr3 As Double
Dim gr4 As Double
Dim average As Double

gr1 = txtFirst.Text
gr2 = txtSecond.Text
gr3 = txtThird.Text
gr4 = txtFourth.Text

average = (gr1 + gr2 + gr3 + gr4) / 4


txtAverage.Text = average

End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnClear.Click
txtFirst.Clear()
txtSecond.Clear()
txtThird.Clear()
txtFourth.Clear()
txtAverage.Clear()

End Sub
End Class

Test Data
1. Valid Data
The program accepts only numeric data.

2. Invalid Data
The program does not accept alphabetic and alphanumeric
characters. The following errors will be encountered when
null and alphanumeric values are entered.

Input Error
null InvalidCastException
alphanumeric values InvalidCastException

You might also like