0% found this document useful (0 votes)
25 views31 pages

TOPIC 1 - An Overview of MS Visual Basic[1]

The document provides an overview of MS Visual Basic, including definitions of programming, programs, and programming languages. It outlines the problem-solving process through the Program Development Life Cycle (PDLC), which consists of five phases: Analysis, Design, Implementation, Testing, and Maintenance. Additionally, it explains the use of flowcharts and pseudocode for algorithm representation and highlights common types of errors encountered in programming.

Uploaded by

2025161321
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views31 pages

TOPIC 1 - An Overview of MS Visual Basic[1]

The document provides an overview of MS Visual Basic, including definitions of programming, programs, and programming languages. It outlines the problem-solving process through the Program Development Life Cycle (PDLC), which consists of five phases: Analysis, Design, Implementation, Testing, and Maintenance. Additionally, it explains the use of flowcharts and pseudocode for algorithm representation and highlights common types of errors encountered in programming.

Uploaded by

2025161321
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

TOPIC 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

 Known as flow direction


 Represents that control passes to the symbol
the arrow points to.

 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

 Represented as diamond (rhombus)


 A junction where a decision must be made
 Typically contain a Yes/No questions or True/False test
Flowchart (cont.)
 Connector symbol

 Represents the exit to or entry from,


another part of the same flowchart.
 Usually used to break a flow line that will
continued elsewhere.
Phase 3: Implementation
 Process
of transforming an algorithm into
computer program
 Coding
involves editing, compiling and
debugging
 Type of error:
 Syntax error
Syntax Error/Compile Error
 An error occurs when your code violates
one or more Visual Basic’s rules for
punctuation, format or spelling.
 Detected by the compiler as it attempts
to translate your program into machine
language.
 E.g.:
Close ‘after a method name,
Close must include open and close
parentheses, Close()
 Also called compile error.
Phase 4: Testing
 Findingand eliminating errors (known as
bugs) by testing the program with all
types of data and cases.
 Also
known as debugging (to remove
bugs).
 Type of errors:
 Run-time error
 Logic error
Run-Time Error
 Cause your projects halts during
execution .
 Occurs when the program directs the
computer to perform an illegal operation
such as dividing a number by zero.
 E.g.: a = n/0; ‘division by zero
 Also called execution-time error
Logic Error
 An error such that a program runs , but
produce incorrect results.
 Often produced by an incorrect
calculation, the wrong text appears or the
text is okay but appears in wrong location
 E.g.:
remainder = a/b; ‘instead of
using Mod operator (modulus),
division operator is used.
 Very difficult to detect.
Phase 5: Maintenance
 Modifying
or upgrading the existing
program or system.
 Program maintenance is an important
part of the process because it keep the
programmer’s work up-to-date and in use.
 Youmust document your program so that
you and other programmers can make
changes or updates later.
Phase 5: Maintenance (cont.)
 Documentation may also useful for the
program’s users.
 Three types of documentation:
 Documentation in the program – that is
included in the program (comments/remarks)
 Documentation outside of the program –
explain how the programming problem was
solved (e.g. diagrams, flowcharts, descriptions)
 Documentation for the user – user manual that
explains the functions of the program/software
Any Questions?

You might also like