Introduction To Visual Basic Programming
Introduction To Visual Basic Programming
Programs:
Detailed set of instructions/directions given to computers
to execute in order to generate a desired outcome
Written by programmers using specialized languages
Programmers:
people who write programs
Programmers write computer programs to solve problems
that require a computer solution
3
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
Basic Functions of a Program
The basic function of many programs is to:
When you want the program to run, you can have the
program loaded into RAM and executed
Identify Input
What information will the computer need to know
to print, display, or store the output items?
12
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
Step 1 – Analyze Problem ONE
Input?
Annual Sales
Commission Rate
Output?
Annual Commission
Process?
Multiply Annual sales by commission rate (result
is the user’s annual commission)
13
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
Step 2 – Plan the Algorithm
Pseudo code
False code, not standardized
Cannot be understood by a computer
Used by programmers when planning an
algorithm
Flowchart
Uses standardized symbols to visually depict an
algorithm
14
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
Step 2 – Plan Algorithm One
Input?
Annual Sales
Commission Rate
Output?
Annual Commission
Algorithm
1. enter the annual sales and commission rate
2. calculate the annual commission by multiplying the
annual sales by the commission rate
3. display the annual commission
15
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
Step 2 – Plan the Algorithm (2)
Flowchart symbols
Oval: start/stop symbol
Parallelogram: input/output symbol
Rectangle: process symbol
Flowlines
Connect symbols
Processing item:
intermediate value that algorithm uses when processing
input into output
16
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
Algorithm 1 – Flow Chart
Input?
Current Pay
Percentage of Raise
Output?
New Pay
Process?
Multiply current pay by
percentage of raise(result is the
user’s new pay)
17
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
Step 1 – Analyze Problem TWO
18
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
Step 1 – Analyze Problem Two
Input?
Current Pay
Percentage of Raise
Output?
New Pay
Process?
Multiply current pay by percentage of raise and
add the value to the current pay(result is the
19
user’s new pay)
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
Step 2 – Plan Algorithm Two
Input?
Current Pay
Percentage of Raise
Output?
New Pay
Algorithm
1. Enter the current pay and percentage of raise.
2. Calculate the raise by multiplying current pay by
percentage of raise.
3. Calculate new weekly pay by adding the value of the
raise to the current pay.
4. Display the new weekly pay.
20
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
Plan Algorithm Two – Flow Chart
Input?
Current Pay
Percentage of Raise
Output?
New Pay
Process?
Multiply current pay by
percentage of raise
add the value to the current pay
result is the user’s new pay
21
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
Step 1 – Analyze Problem Three
22
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
Step 3 – Desk-Check the Algorithm
Desk-checking (hand-tracing)
Programmer reviews algorithm while seated at
his/her desk
Valid data
Data that algorithm is expecting user to enter
Invalid data
Data that algorithm is not expecting user to enter
25
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
Step 3 – Desk-Check the Algorithm
26
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
What Is Visual Basic? (1/2)
Visual Basic is modern, high-level, multi-paradigm,
general-purpose programming language for building
applications using Visual Studio and the .NET
Framework.
BASIC
Visual Basic is from Basic:
BASIC - Beginners All-purpose Symbolic Instruction
Code
a programming language used more than 20 years ago
as part of MS-DOS.
28 CICS 313: Visual Basic Programming - GTUC 2021 Delivery
The Versions of Visual Basic
Visual Basic 1.0 first appeared in 1991.
Platform/language independent
36
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
.NET Class Library (1 of 2)
A class is a named group of program code
A button is an example of a class
Copyright © 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a
publicly accessible website, in whole or in part.
.NET Class Library (2 of 2)
A button created from a class is called an object, or
sometimes an instance of a class
42
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
Visual Studio IDE (1/2)
Visual Studio is Microsoft’s integrated development
environment (IDE) for creating, running and debugging
applications.
44
CICS 313: Visual Basic Programming - GTUC 2021 Delivery
Any Questions?
48
CICS 313: Visual Basic Programming - GTUC 2021 Delivery