You are on page 1of 6

Reviewer ICT

Week 2
VB programming
INTRODUCTION TO VISUAL BASIC
What is a computer?
 It is an electronic device capable of performing complex computations in a
short time

 It is a fast electronic calculating machine that accepts input information,


processes it according to a list of internally stored instructions called a
program, and produces the resultant output information

What is a Program?
 It is a set of instructions telling a computer what to do
What is a Programing?
 The craft of implementing one or more interrelated abstract algorithms
using a particular programming language to produce a concrete
computer program
 Visual Basic Overview
 Visual Basic (VB) is a high level programming language evolved from the
earlier DOS version called BASIC.
 VB is a software development system developed by Microsoft to
support creating applications for the Windows operating system.
 VB introduced the concept of an event-driven programming model.
 VB has incorporated the concept of objects.

 History of Visual Basic


 BASIC stands for Beginner’s All-purpose Symbolic Instruction Code.
 Developed by John Kemeny and Thomas Kurtz in mid 1960s.
 Visual Basic was developed in mid 1991 by the Microsoft Corporation.
Why Visual Basic?
 Power and complete Windows application development system
 Supported by third party products
 Support the principles of object driven design
 Very flexible
 User friendly
 Provides a Graphical User Interface or GUI
 The sequence of instructions executed in the program is controlled by
events

Week 3
 Graphical User Interface(GUI)
 Windows is a Graphical User Interface (GUI)
 GUI’s allow users to easily operate computers using a pointing device
(such as a mouse)
 Prior to windows 3.1 IBM PCs used a command line interface (MS DOS)
 All commands, input and screen output was textual, one line at a time.
 Without knowing commands, users would be unable to proceed.

 Event-Driven Programming
 Procedural Programs
 Execution starts with the first line
 Program moves to different sections as required
 Event-Driven Programs
 Instead of one program there are independent sets of instruction
 Each event is associated with a separate set of instructions
 Code remains idle until called upon to respond to some event (button
pressing, menu selection, etc.)
 VB Terminologies
Control
 A tool used to create objects on a Visual Basic form. It is used to create
interface elements, such as command buttons, image boxes, list boxes, etc.
Objects
 The name of a user interface element you create on a Visual Basic Form by
using a toolbox control.
Property
 A value or characteristics held by a Visual Basic object, such as Caption or
ForeColor. Properties can be set at design time by using the Properties
window or at run time by using statements in the program code.
Event Procedure
 A block of code that is executed when an object is manipulated in a program.
They typically evaluate and set properties and use other program statements
to perform the work of the program.
Method
 A special statement that performs an action or a service for a particular
object in a program.
Inheritance
 Objects are organized into objects classes, which are groups of objects
sharing structural and behavioral characteristics.
Week 4 – 5

Encapsulation
 The result (or act) of hiding the implementation details of an object from its
user.
Abstraction
 The benefit of being able to ignore the inner details of an object in order to
focus on the aspects of the object needed to use.
Polymorphism
 Creates objects that perform the same functions as the base objects but
performs some of these functions in a different way.
 Integrated Development Environment (IDE)
 Like any other Windows application, App Inventor consists of multiple
windows which appear at startup.
 The windows displayed are collectively known as the App Inventor Inegrated
Development Environment (IDE).
 In particular, AI has the following windows:
• Main Window which contains Menu and Toolbar
• Toolbox
• Project Explorer Window
• Property Window
• Forms
• Code Window

Main Window
• This is the only element of the IDE which is always visible
• Selects which other IDE elements to view and to add forms or controls
to your project
Toolbox Window
• This is simply a library of controls which can be placed on the application
• It is used to add labels, buttons, scroll bars, menus, etc. To the user
interface
Project Window
• This is simply a list of all forms and modules which make up your AI
project.
Property Window
• Controls such as buttons, text boxes, picture boxes and other feature of
most AI applications allow you to enter parameters which define how
these control work.
• In AI, these parameters are called properties
Form Window
• They are the windows which hold the various controls (buttons, text
boxes, etc.) which make up your application.
Code Window
• This is where you type in the code that AI executes.

 Program Development Cycle


1. Analyze: Define the problem
• A common programming error is to begin coding before analysis of the
problem and design of the solution is complete.
• What is the problem?
• Are there any special requirements of the solution?
2. Design: Plan the solution to the problem
• The solution should consist of a logical sequence of steps, called an
algorithm.
3. Choose the interface: Select the objects
4. Code: Translate the algorithm into a programming language
5. Debug and Test: Locate and remove any errors in the program
6. Complete the Documentation: Organize all the materials that describe the
program

You might also like