TOPIC 1 - An Overview of MS Visual Basic[1]
TOPIC 1 - An Overview of MS Visual Basic[1]
An Overview of MS Visual
Basic
Lesson Outcomes
At
the end of these lessons, students
should be able to:
Define program and programming.
Learn basic problem solving techniques
Use the tools (flowchart and pseudocode) to
solve the problem
PART 1
Introduction to Computer, Program and
Programming Language
Computer
Computer is …
An electronic machine, operating under the
control of instructions stored in its own
memory.
Basic operations of a computer:
Input – accepting data from a user
Process – manipulating data
Output – producing results
Storage – storing results
These operations are under the control of
instructions stored in the computer’s memory.
Programming Using Visual
Basic
Visual
Basic is a programming
language, which provides us with an
easy way to write computer programs.
What is Program?
Program (computer program) is …
Set of instructions that directs computer to
perform tasks
Also known as software
A program tells a computer what to do.
Example of computer programs:
Calculator application in Windows
MS Word
Facebook
What is Programming?
Programming is …
A process of problem solving
Also known as software development
What is Programming
Language?
Programming language is …
A set of words, symbols and codes that
enables a programmer to communicate
instructions to a computer.
Used to write instructions.
Example: Visual Basic, C++, Java, Phyton
PART 2
Process of Problem Solving
Steps in Problem Solving
Process of problem solving involved 5 steps
procedure
Also known as program development life
cycle (PDLC)
Phase involved in PDLC:
Analysis
Design
Implementation
Testing
Maintenance
Program Development Life
Cycle
Analysis
Maintenance Design
Testing Implementation
Phase 1: Analysis
Analyze or define the problem to be
solved with clearly understood the
specifications of the problem.
Identify the inputs, processes and outputs.
Input: the data flowing into the system
from outside (raw data)
Process: the action of manipulating the
input into a more useful form
Output: the information flowing out of the
system.
Phase 1: Analysis (cont.)
Proces
Input Output
s
E.g.:
Problem : Find the area of rectangle
Input : length and width
Process : area=length x width
Output : The area of rectangle
Example: Analysis
Problem specification:
Write a program that takes as input a given
length expressed in inches. It then converts
and outputs the length in centimeters.
Example: Analysis (cont.)
Problem : to calculate the equivalent length
in centimeters
Input : length in inches
Process : length in cm = length in inches x
2.54
Output : length in cm
Phase 2: Design
List down or draw the steps involved in
sequence to solve the problem.
Algorithm is a sequence of precise
instructions that leads to a solution
Two common ways to express the algorithm:
Pseudocode: is like a common word or
human words such as English like wording
used to represent algorithm
Flowchart: a diagram made up of symbols
used to illustrate an algorithm
Pseudocode
Pseudocode is a type of structured English
that is used to specify the steps required
to accomplish the task.
There are no real formatting or syntax
rules.
Pseudocode (cont.)
Problem: To find the perimeter and area of
rectangle
Start
Get length, width
perimeter = 2 * (length + width)
area = length * width
Display perimeter, area
End
Flowchart
Graphical
representation of
an algorithm.
Flowchart (cont.)
Flowchart symbols:
Start and end symbols
Represented as lozenges.
Usually containing the word “Start” or
“End”.
Flowchart (cont.)
Arrow
Process symbol
Represented as rectangles
Represents any process or action
Flowchart (cont.)
Input / Output symbol
Represented as a parallelogram
Represents data that is available for input or output
from processing
Decision symbol