CMPT 110 - PowerPoint PPT Presentation

1 / 26
About This Presentation
Title:

CMPT 110

Description:

Introduction to Visual Basic and Program Design. Course Website ... Note that interface design is a large subject (and the topic of entire courses) Implementation ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 27
Provided by: johne78
Category:
Tags: cmpt | courses | dos

less

Transcript and Presenter's Notes

Title: CMPT 110


1
CMPT 110
  • Introduction to Visual Basic and Program Design

2
Course Website
  • http//sleepy.cs.surrey.sfu.ca/cmpt/fall2005/cmpt1
    10/

3
Assessment
  • Assessed labs 5
  • Assignments 25
  • Midterm exam in class 25
  • Final exam (18th of April) 45

4
What is Visual Basic?
  • A Programming Language
  • The language is derived from BASIC, an easy to
    understand language created in the 1960s
  • A set of tools for creating form or dialog box
    based Windows applications
  • The tools are visual and relatively easy to use
    with little programming

5
Windows
  • Windows XP allows users to manipulate a pointing
    device (mouse) to control a PC
  • This kind of user interface is known as a
    Graphical User Interface (or GUI)
  • Historical note the idea of such a GUI predates
    Windows

6
Windows
  • Windows XP (and previous versions) allows users
    to manipulate a pointing device (mouse) to
    control a PC
  • The interface is called Windows because each
    application runs inside a bordered rectangular
    region known as a window
  • This kind of user interface is known as a
    Graphical User Interface (or GUI)
  • Historical note the idea of such a GUI predates
    Windows

7
Windows
  • Windows XP allows users to manipulate a pointing
    device to control a PC
  • This kind of user interface is known as a
    Graphical User Interface (or GUI)
  • interface n. v. 2 a point where interaction
    occurs between two systems 3 an apparatus for
    connecting two pieces of equipment so that they
    can be operated jointly (OED)
  • Historical note the idea of such a GUI predates
    Windows

8
Windows
  • Windows XP allows users to manipulate a pointing
    device to control a PC
  • This kind of user interface is known as a
    Graphical User Interface (or GUI)
  • Historical note the idea of such a GUI predates
    Windows
  • Mouse (and its use with windows) invented in 1964
    by Douglas Englebert
  • Apple released the first home computer with a
    graphical user interface in 1983
  • Windows 1.0 (a "shell" interface built on top of
    MS DOS) released in 1985

9
Windows 1.01 (1985)
10
Windows 2.0 (1987)
11
Windows 3.0 (1990)
12
Window Anatomy
Title Bar
System Menu
Menu Bar
Minimize, Maximize and Close Buttons
Cursor
Vertical Scroll Bar
Work Area
Horizontal Scroll Bar
13
Why Visual Basic?
  • Allows for relatively easy development of GUI
    Windows applications
  • Instead of writing code to create the application
    GUI VB, uses its own GUI to allow the programmer
    to effectively draw the interface
  • Note that a specialized subset of VB called
    Visual Basic for Applications (VBA) is used to
    customize MS Office products
  • VB creates controls with default functionality
  • e.g. controls recognize mouse clicks

14
VB Application Development
  • Design the appearance of the window that the user
    will use
  • Often a form or dialog box
  • Determine the events that the window and its
    controls should recognize
  • Write procedures for each event
  • A VB program is event driven rather than a
    traditional program

15
Procedural Programming
  • A traditional, or procedural, program runs from
    the top down
  • Execution starts with the first line and moves
    through the program until the last line is
    reached
  • Branching and repetition are performed as
    required
  • VB programs, however, are event driven

16
Event Driven Programming
  • Instead of one program there are a number of
    independent instruction sets
  • Each such instruction set is associated with one
    event
  • Such as typing in an edit box, clicking on a
    command button, or selecting a radio button
  • User input is processed via messages from the
    operating system

17
Recognizing Events
  • The operating system (Windows) recognizes events
    (mouse clicks etc.)
  • These events are inserted in an event queue, and,
    in turn, dealt with by an event loop
  • A message is sent to the appropriate
    application's event handler (with its own event
    loop) to process the event
  • The set of instructions associated with an event
    is then carried out

Windows does this for you!!
Visual Basic does this for you!!
This is the only part you are responsible for
18
Program Development
  • Software (in this case VB applications) should be
    planned before being implemented
  • There are a number of steps that are usually part
    of the software lifecycle

19
Software Lifecycle
  • Analysis
  • Design
  • Implementation
  • Testing
  • Documentation (all phases)
  • Maintenance

20
Analysis
  • Define the problem
  • Understand what is to be produced by the program
    (the output)
  • Understand what information is to be given to the
    program (input)
  • Determine any specific requirements e.g.
  • Performance (speed, size)
  • Platform

21
Design
  • Plan the solution to the problem
  • If necessary, break the problem into a number of
    smaller sub problems
  • Find a precise and unambiguous sequence of steps
    to solve each sub problem
  • Document each such sequence of steps
  • Test the solution (by hand) to make sure that it
    works
  • Design the interface

decomposition
an algorithm
22
Interface Design
  • Determine what controls are to be used to
  • Receive input and
  • Display output
  • Determine what buttons and menus are needed to
    allow the user to control the application
  • Determine how these controls are to be placed to
    make the application user friendly
  • Note that interface design is a large subject
    (and the topic of entire courses)

23
Implementation
  • Create the interface specified in the design
    phase
  • Use the VB GUI to create the window and controls
    and to set their properties
  • Translate the algorithms determined in the design
    phase into a programming language
  • In our case into VB code that should be used in
    the appropriate event procedures

24
Testing
and debugging
  • Test each component of the application
  • These tests should be rigorous and complete
  • Fix any errors that are discovered, errors fall
    generally into three classifications
  • Compilation errors (e.g. language syntax errors)
    that prevent the program from compiling and being
    run
  • Run-time errors that cause the program to stop
    running (i.e. crash)
  • Logic errors that make the program produce the
    incorrect result
  • Note that, ideally, test cases should be written
    during the design phase

25
Documentation
  • The program should be documented throughout the
    entire lifecycle and can be used to assist in
    specifying the program requirement
  • Note that code should be written so that it is
    easy to understand and includes internal
    documentation

i.e. comments
26
Maintenance
  • Most software has to be maintained after it has
    been created
  • This includes delivering updates (or patches in
    the unlikely event that the application wasn't
    initially perfect)
  • For large scale applications maintenance is often
    costlier than development
Write a Comment
User Comments (0)
About PowerShow.com