Problem Solving: Chapter 2-Visual Basic Schneider 1
Problem Solving: Chapter 2-Visual Basic Schneider 1
Problem Solving
Schneider
Schneider
Programming Languages:
Machine Language Assembly Language High level Language
Schneider
Machine Language
The fundamental language of the computers processor, also called Low Level Language. All programs are converted into machine language before they can be executed. Consists of combination of 0s and 1s that represent high and low electrical voltage.
Schneider
Assembly Language
A low level language that is similar to machine language. Uses symbolic operation code to represent the machine operation code.
Schneider
Schneider
Schneider
Schneider
Programming Tools:
Flowchart Pseudocode Hierarchy Chart (Structure chart)
Schneider
What is a flowchart?
Logic diagram to describe each step that the program must perform to arrive at the solution. A popular logic tool used for showing an algorithm in graphics form.
Schneider
10
Continue flowchart
Programmer prepares flowchart before coding. Most common flowchart symbols are:
Schneider
11
Purpose of Flowcharting:
An aid in developing the logic of a program. Verification that all possible conditions have been considered in a program. Provides means of communication with others about the program. A guide in coding the program. Documentation for the program.
Chapter 2- Visual Basic Schneider 12
Example of Flowchart:
Start
Initialize Counter =1 and sum to 0
No
Yes
Get next grade
Desk Checking
The process of testing the flowchart with different data as input, and checking the output.
The test data should include nonstandard data as well as typical data.
Schneider
14
What is a Pseudocode?
A program design technique that uses English words. Has no formal syntactical rules.
Schneider
15
Example of Pseudocode:
Determine the average grade of a class:
Do while there are more data Get the next Grade Add the Grade to the Sum Increment the Counter Loop Compute average = Sum / Counter Display average
Schneider
16
Schneider
17
Get Grade
Compute Sum
Calculate Average
Display Average
Schneider
18