la5 programming

14
PROGRAMMING Program Development 040407 Prepared by: Norhasimah Mohamed, Head Of ICT Panel, SMK Sungai Pusu, Gombak Selangor.

Upload: shimamohd

Post on 29-Nov-2014

1.348 views

Category:

Business


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: La5 Programming

PROGRAMMING

Program Development

040407

Prepared by: Norhasimah Mohamed, Head Of ICT Panel, SMK Sungai Pusu, Gombak Selangor.

Page 2: La5 Programming

Learning Outcomes

• Apply program development phases to solve problems

• Develop a program

Page 3: La5 Programming

Situation

• 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

Page 4: La5 Programming

Programming Development Phase

1. Problem Analysis

2. Program Design

3. Coding

4. Testing and Debugging

5. Documentation

Page 5: La5 Programming

1. Problem Analysis

• What the problem?

• What the input, process, and output?

• What the formula on how to calculate the mathematic operations?

Page 6: La5 Programming

2. Program Design

• Write the pseudo code

• Write flow chart

• Design user interface

Page 7: La5 Programming

Pseudo code

PROGRAM Mathematic_OperationsREAD the first numberREAD the second numberREAD commandbutton Add

CALCULATE the sum of number 1 and number 2PRINT the answer for Addition

END PROGRAM

Page 8: La5 Programming

Flow Chart

START

READ number 1 & 2

CALCULATE

STOP/END

PRINT the answer

Page 9: La5 Programming

User Interface

Page 10: La5 Programming

3. Coding

• SCRIPTING

Page 11: La5 Programming

Coding

‘formula for additional (internal documentation)

Private Sub cmdAdd_Click()Dim Number1, Number2 As Integer Number1 = txtNumber1.Text Number2 = txtNumber2.Text txtSum = Number1 + Number2End Sub

Page 12: La5 Programming

4. Testing and Debugging

• RUN & COMPILING

Page 13: La5 Programming

5. Documentation

• Internal Documentation

• External Documentation

Page 14: La5 Programming

Exercises

• Modify the additional formula to use for subtractions, multiplication and division.