Apply program development phases to solve problems
Develop a program
Your younger brother has a problem with a basic mathematic operations like addition, subtraction, multiplication, and division. Your parents ask you to develop one simple system using Visual Basic to help your brother.
Your system should have function button to calculate the additional, subtraction, multiplication, and division for at least two integer numbers
Programming Development Phase
Testing and Debugging
1. Problem Analysis
What the problem?
What the input, process, and output?
What the formula on how to calculate
the mathematic operations?
2. Program Design
Write the pseudo code
Write flow chart
Design user interface
READ the first number
READ the second number
READ command button Add
CALCULATE the sum of number 1 and number 2
PRINT the answer for Addition
Flow Chart START READ number 1 & 2 CALCULATE STOP/END PRINT the answer
‘ formula for additional (internal documentation)
Private Sub cmdAdd_Click()
Dim Number1, Number2 As Integer
Number1 = txtNumber1.Text
Number2 = txtNumber2.Text
txtSum = Number1 + Number2
4. Testing and Debugging
RUN & COMPILING
Modify the additional formula to use for subtractions, multiplication and division.