Professional Documents
Culture Documents
Program Representation
Simon H. Muchinenyika
smuchinenyika@nust.na 2021 Semester I
Introduction to Computing
(ITC511S)
Faculty of Computing and Informatics
Contents
1. Introduction 3. Desk-check
• Programming Process • Testing Program’s Logic
• Examples • Solution Walk Through
2. Pseudocode 4. Flowcharts
• Designing Logic • Program Representation
• Sequential Statements • Flowchart Symbols
• Why Pseudocode • Software
Introduction 1/5
1. Introduction
6. Pseudocode
• false code where informal instructions are created for human
consumption and not computer
• Example:
Take a small bowl
Add two eggs
Stir
Take a small frying pan
Add oil
Heat oil for 3 minutes
Pour the mixed eggs into pan
Heat for a minute
Serve with bread
7. Sequential Statements
• instructions executed in order to completion;
• note that evert statement should be executable;
• below are commonly used verbs in psudocode to define
specific operations:
Verb Example Description
get get number receives number as input from user input
read read reads number as input from a file or d/base
compute compute average a process that computes the average. An
alternative is the verb calculate
display display average outputs average to the screen. An
alternative is the verb print
write write average outputs average to a file or d/base
Pseudocode 3/4
9. Benefits of Pseudocode
• makes reviews easier without examining the code;
10. Desk-checking
• testing a proposed solution is done by walking data through
pseudocode;
• for every data input used, there should be an expected output;
• numbering a solution from the previous slide we get:
Start
1 prompt for studentRecord1
2 get studentRecord1
3 prompt for studentRecord2
4 get studentRecord2
5 total = studentRecord1.studentAge + studentRecord2.studentAge
6 averageAge = total / 2
7 dispay averageAge
End
Desk-checking 2/2
12. Flowcharts
• an alternative to pseudocode;
student = {studentNumber,
studentName, studentAge}
Flowcharts 3/4
• processing symbol;
• creately: https://creately.com
• etc.
MAD811S Mobile World
• Desk-checking:
https://sites.google.com/a/campioncollege.com/it_eveningschoool/
problem-solving-and-programming/desk-check-guide
13 Storch Street T: +264 61 207 2054
Private Bag 13388 F: +264 61 207 9054
Windhoek E: smuchinenyika@nust.na
NAMIBIA W: www.nust.na
Thank You.