Advanced Interactive Programming COM533J1 BSc IMD - PowerPoint PPT Presentation

1 / 60
About This Presentation
Title:

Advanced Interactive Programming COM533J1 BSc IMD

Description:

Aims, content, teaching methods, learning outcomes, schedule, ... IDEs provide a user-friendly framework for many modern programming languages, ... VB and IDEs ... – PowerPoint PPT presentation

Number of Views:103
Avg rating:3.0/5.0
Slides: 61
Provided by: ChrisN83
Category:

less

Transcript and Presenter's Notes

Title: Advanced Interactive Programming COM533J1 BSc IMD


1
Advanced Interactive ProgrammingCOM533J1 (BSc
IMD)
  • Dr Luke (Liming) Chen
  • School of Computing and Mathematics
  • email l.chen_at_ulster.ac.uk

2
Outline
  • Module overview
  • Aims, content, teaching methods, learning
    outcomes, schedule, assessment methods, etc.
  • Introduction to basic computing concepts
  • Computer, computer architecture, operating
    systems, programming languages, etc.
  • VB IDE and language revision (tutorial and
    practical)
  • IDE and menus, statement and control structures,
    procedure, etc.

3
Module Overview
4
Module Aims
  • To enable students to master the concepts of
    object oriented and component-based programming
    for interactive systems.
  • To provide students with practical experience of
    writing and managing large scale programs with
    graphical user interfaces.
  • To introduce students to various advanced
    applications in multimedia programming.

5
Learning Outcomes
  • Use a project development environment to design,
    create and test software components, integrate
    them, and test and distribute the software.
  • Analyse an existing software component and use it
    effectively in a program.
  • Specify, design and implement a software
    component using object-oriented techniques.
  • Use usability principles throughout the
    development process.
  • Use various multimedia programming techniques in
    an advanced piece of software.

6
Module Content (1)
  • Introduction
  • Operating systems
  • Graphical components in message-based user
    interfaces
  • Message queues and event handling
  • Object oriented programming
  • Fundamental concepts - classes, objects,
    encapsulation, properties, methods,
    message-passing, polymorphism and inheritance.
  • Programming techniques - programming, referencing
    and deleting classes, objects, objects methods
    and variables event handling polymorphism,
    inheritance and exceptions.
  • Use OOP for application development

7
Module Content (2)
  • Software Process Management
  • The project concept, libraries, modular
    programming.
  • Creation and distribution of executable software.
  • Verification, validation and usability testing.
  • Component-Based Programming
  • Fundamental concepts - Components, component
    interfaces and re-usability.
  • Programming techniques - Creating and using
    components components for distributed
    programming.
  • Use CBP for application development
  • Advanced Applications
  • Graphics programming
  • File handling

8
Teaching and Learning Methods
  • A combination of lectures, tutorials, practicals
    and self study, directed study and exercises.
  • Lectures 24 hours
  • Tutorials 12 hours
  • Practicals 24 hours
  • Assignment prep. 42 hours
  • Directed reading 12 hours
  • Private study 86 hours

9
Lecture Schedule
  • Week 1 Introduction to the module and computer
    fundamentals
  • Week 2 Visual programming concepts and
    components
  • Week 3 Object oriented programming concepts
    such as object, class, information hiding
  • Week 4 Object oriented programming
    inheritance and polymorphism
  • Week 5 Object oriented programming delegation,
    error handling
  • Week 6 File handling

10
Lecture Schedule
  • Week 7 Component-based programming ActiveX
    technologies, ActiveX components
  • Week 8 Component-based database management
  • Week 9 Advanced multimedia programming
  • Week 10 Component-based Internet programming
  • Week 11 Software process management
  • Week 12 Revision

11
Tutorials and Practical Sessions
  • Each lecture will be followed by a tutorial and a
    practical session.
  • Tutorial and practical sessions will complement
    lectures.
  • Tutorial is used to help understand concepts and
    assist with problems, assignments and exam
    preparation.
  • Practicals are used to develop your programming
    skills..
  • Attendance is mandatory and all work will be
    assessed weekly.

12
Assessment Strategies
  • Coursework/Examination - weighting 50 / 50
  • Written exam
  • Unseen, closed book examination of 3 hours
    duration.
  • Attempting 4 out of 6 optional questions, each
    worth 25 marks.
  • Question types
  • To explain particular concepts
  • To apply these concepts to solve a particular
    problem.

13
Assessment Strategies (I)
  • Coursework assignments
  • Assignment1 Class test - end of week 6 (50
    mins).
  • Assignment2 Create a piece of software which
    makes use of the concepts acquired throughout the
    module (week 3 to week 11).
  • Marking Criteria
  • Correctness of the solutions
  • Usability of the solution,
  • Programming style (indentation, commenting,
    readability, etc)
  • Assignment weighting
  • Assignment1 - 40
  • Assignment2 - 60

14
Supporting Material
  • Recommended text book
  • Harvey M Deitel and Paul J. Deitel. (1999) Visual
    Basic 6 How to Program. Prentice-Hall ISBN 0
    1345 6955 5
  • Indicative reading list
  • Dan Appleman. Dan Applemans Developing ActiveX
    Components with Visual Basic 6. (1998) Sams
    ISBN 1562765760
  • F. Balena. Programming Visual Basic 6 (1999)
    Microsoft Press International ISBN 0735605580
  • Matt Curland and Bill Storage. (2000) Advanced
    Visual Basic 6. Addison Wesley. ISBN 0 2017 0712
    8
  • Dan Fox. (1999) Pure Visual Basic 6. Que. ISBN 0
    6723 1598 X
  • Some directed reading materials will be given in
    classes

15
Timetable
  • Semester one
  • Weeks 1-12
  • Week 12 for revision
  • Monday
  • Lecture 1115 1315 - 05B01
  • 10 minutes break at 1210am
  • Tutorial 1315 1415 - 01K06
  • Practical 1515 1715 - 16C29

16
Question Answering
  • Your feedback, suggestions are welcome, as our
    class has small number of students, could be more
    flexible and informal
  • Asking questions are encouraged
  • Office hours
  • Tuesday morning, Wednesday afternoon 16E06
  • Other weekdays by appointment via email or
    telephone
  • Tel 68837 (ext.), email l.chen_at_ulster.ac.uk
  • If you are unhappy with me or the lecturing,
    speak to me directly or the course director.

17
Requirements
  • Prerequisite Interactive Programming COM148J2
  • Attend all lectures except with a good reason
  • Complete all exercises in practical classes
    solutions to lab practicals should be returned
    before next practical session.
  • Self-study and read associated materials
  • Participate discussions via module mailing list
  • All lectures slides, tutorial and practical
    materials will be available on the module website
    in WebCT.

18
Introduction to Basic Computing Concepts
19
Computing Concepts
  • Computer
  • Computer architecture
  • Operating systems
  • Programming languages

20
What is a Computer?
  • Computer
  • Device capable of
  • Performing computations
  • Processing information
  • Making logical decisions
  • Works billions of times faster than human beings
  • Programs
  • Sets of instructions that process data
  • Guide computer through orderly sets of actions
    specified by computer programmers

21
Computer Architecture
  • The structure of a computers functional parts,
  • How they interact and how this interaction
    facilitates the task of the computer to run
    programs.
  • Data and control flows
  • between components

22
Functions and Interactions
  • Hardware Provides basic computing resources
    such as CPU, memory, I/O devices
  • Operating system Controls and coordinates use
    of hardware among various applications and users
  • System programs Provide general-purpose
    functions such as file management, programming
    language support, program loading, communication,
    etc.
  • Application programs Application or user
    specific systems that define the ways the system
    resources are used to solve the computing
    problems of the users such as Word processors,
    compilers, web browsers, database systems, video
    games
  • Users - People, machines, other computers

23
Computer Organization
  • A computer can be divided into six units
  • Input unit
  • Receiving section of computer
  • Obtains data from input devices - usually a
    keyboard, mouse, disk or scanner
  • Places data at disposal of other units
  • Output unit
  • Shipping section of computer
  • Puts processed information on various output
    devices - screens, paper printouts, speakers
  • Makes information available outside the computer

24
Computer Organization (II)
  • Memory unit
  • Rapid access, low capacity warehouse
  • Retains information entered through input unit
  • Retains information that has already been
    processed until can be sent to output unit
  • Often called memory, primary memory, or random
    access memory (RAM)
  • Arithmetic and logic unit
  • Manufacturing section of computer
  • Performs calculations (addition, subtraction,
    multiplication and division)
  • Contains decision mechanisms and can make
    comparisons

25
Computer Organization (III)
  • Central processing unit (CPU)
  • Administrative section of computer
  • Coordinates and supervises other sections
  • Secondary storage unit
  • Long-term, high-capacity warehouse
  • Stores programs or data not currently being used
    by other units on secondary storage devices (like
    discs)
  • Takes longer to access than primary memory

26
Operating System
  • Acts as an intermediary (an interface) between a
    user of a computer and the computer hardware.
  • Manages hardware, provides a basis (a running
    environment) for system and application programs
  • Objectives
  • Control/execute system/application programs.
  • Make the computer system convenient to use.
  • Make solving user problems easier.
  • Use the computer hardware in an efficient manner.

27
Operating System Services (I)
  • User interface - Almost all operating systems
    have a user interface (UI), including GUI and CLI
  • Program execution - to load a program into memory
    and to run that program, end execution, either
    normally or abnormally
  • Access to I/O devices - to provides a uniform
    interface for various devices
  • File system manipulation - to read and write
    files from/to directories, create and delete
    them, search them, list file information,
    permission management, protection mechanisms

28
Operating System Services (II)
  • Communications
  • Processes may exchange information, on the same
    computer or between computers over a network
  • Program development
  • Editors, compilers, and debuggers not part of
    the core, but usually supplied with the OS.
  • Error detection and response
  • internal and external hardware errors such as
    memory error, device failure,
  • software errors such as arithmetic overflow,
    access forbidden memory locations
  • operating system cannot grant request of
    application

29
Operating System Services (III)
  • Resource allocation
  • When multiple users or multiple jobs running
    concurrently, resources must be allocated to each
    of them
  • Accounting
  • collect statistics
  • monitor performance
  • used to anticipate future enhancements
  • used for billing users
  • Protection and security
  • Data
  • System resources
  • Resolves access conflicts

30
Evolution of Operating Systems
  • Early mainframe systems
  • Single-user batch processing (No operating system
    at all)
  • Jobs on decks of punched cards
  • One job ran at a time
  • Results took hours to process
  • Computer operator
  • Multiprogramming
  • Simultaneous operation of several jobs
  • Computer resources split between jobs
  • Still took long hours for results

31
Evolution of Operating Systems (II)
  • Early mainframe systems
  • Operating Systems
  • Managed transitions between jobs
  • Increased amount of work computer could
    accomplish
  • Timesharing Operating Systems (1960s)
  • Computers accessed through terminals - devices
    with keyboards and screens
  • Hundreds of people use system at once
  • Quickly performs small portions of each persons
    job
  • Gives appearance of running simultaneously

32
OS for Personal Computing
  • Pioneered by Apple and IBM (1970s)
  • Used by people in office environments
  • Primary goals not maximum utilization of resource
    but convenience and responsiveness
  • Neither multiuser nor multitasking at the
    beginning
  • Transported disks to share information
  • Computer prices dropped get currency in the
    1980s, 1990s
  • Modern operating systems such as Windows2000,
    Window XP, Linux, etc.
  • Support nearly all feature of mainframe systems

33
OS for Distributed Computing
  • Machines linked together
  • Local Area Networks (LANs)
  • Wide Area Networks (WANs)
  • Two structures for distributed systems
  • Client/Server systems
  • One machine as client, one as server
  • Peer to Peer (P2P) systems
  • All nodes are peers
  • Modern OSs support distributed system by
    including protocols and drivers

34
Programming Languages
  • Computers cannot work without programs
  • Programs are written using a programming language
  • A vocabulary and set of grammatical rules for
    instructing a computer to perform specific tasks.
  • Low level or high-level languages in terms of
    level of abstraction from machine language
  • Machine languages
  • Assembly languages
  • High-level languages

35
Machine Languages
  • Language only understood directly by computer
  • Defined by computers hardware design
  • Machine-dependent - Languages specific to
    particular computers
  • Incomprehensible to human readers
  • Streams of numbers - Ultimately reduced to 0s and
    1s
  • Instruct most elementary of operations
  • Slow, tedious and error-prone - Led to Assembly
    languages

36
Assembly Languages
  • English-like abbreviations
  • Represent elementary operations of computer
  • More clear to human readers
  • Still tedious to use
  • Many instructions for simple tasks
  • Led to high-level languages

37
High-Level Languages
  • Instructions comprehensible to humans
  • Look like daily English
  • Contain common mathematical notation
  • Single statements accomplish substantial tasks

38
Example High-level Programming Languages
  • C language of UNIX, Procedural programming, used
    for most operating system, evolved from B
    language at Bell Labs
  • C extension of C, support both procedural and
    object oriented programming, developed at Bell
    Labs
  • JAVA based on C and C, used mainly for Web
    application, write once, run anywhere, platform
    independence, developed at Sun Microsystems
  • C Roots in C, C and Java, adapts best
    features of each language, designed for .NET
    platform specifically developed at Microsoft
  • Each language has a unique set of keywords and a
    special syntax for organizing instructions.
  • Many others
  • VB is a high-level programming language

39
Translation
  • A computer cannot directly understand or run a
    program.
  • Every program must be translated into a machine
    language that the computer can understand.
  • This translation is performed by either a
    compiler, an interpreter or a mixture of the two.
  • This is the job of an OS

40
Running a Program
  • Three ways
  • Through a compiler - translate a program into an
    executable (.exe) and then run the executable.
  • Through an interpreter - translate and execute a
    program one statement at a time in succession,
    without looking at the entire program.
  • Through a compiler and an interpreter - compile a
    program into an intermediate form, and then
    translate and execute the intermediate form code.
  • This is the job of an OS

41
VB IDE and Language Walk-through
42
Visual Basic
  • VB has been specifically designed to build
    applications for the Windows environment.
  • One of the most widely used windows programming
    language.
  • Relatively easy to learn.
  • Create professional looking systems very quickly.
  • Useful for prototyping.
  • Internet connectivity.
  • Provides wizards to assist users.

43
The VB IDE
  • An integrated development environment (IDE) is a
    programming environment that has been packaged as
    an application program.
  • Typically it will consist of a code editor, a
    compiler, a debugger, and a graphical user
    interface builder.
  • IDEs provide a user-friendly framework for many
    modern programming languages, such as .NET
    framework in Microsoft, WebSphere Studio from
    IBM, JBuilder from Borland, NetBeans from SUN,
    etc..

44
VB and IDEs
  • The VB IDE consists of a number of elements such
    as menu bar, project explorer, toolbar,
    properties window, toolbox, editors, etc.
  • The VB environment can be used to create and
    execute programs
  • Programs can also be created within the VB
    environment as executable files to be run outside
    of the environment.
  • VB uses the term project as an analogy to
    program

45
The VB IDE
46
VB Language Fundamentals
  • Data types the most commonly used types of
    variables in VB are
  • Boolean Values can be true or false
  • Byte 8 bit an integer in the range 0-255
  • Integer 16 bit whole number (-32768 to 32767)
  • Long 32 bit whole number (-2 billion to 2
    billion)
  • Single 32 bit decimal number (7 Sig Figs)
  • Double 64 bit decimal number (14 Sig Figs)
  • String strings of text
  • Variant can hold any type. (This is the default
    if the type is not declared.)

47
Variable Scopes
  • Local variables only have the scope of the
    procedure in which they are declared. They cannot
    be accessed outside of it.
  • Module variables apply to variables declared in
    the general declaration of a module, which can be
    accessed by all procedures in the module.
  • Global variables have the scope of the entire
    project and as a result can be accessed or
    modified by any procedure. A global variable must
    be declared as public.

48
Variable Manipulation
  • Arithmetic operators
  • Mathematical calculation such as , -, , /, mod,
    etc
  • Relational operators (comparison)
  • Simple conditions such as gt, gt, lt, etc
  • Logical operators
  • Complex conditions by combining simple
    conditions, such as and, or, not

49
Control Structures in VB
  • There are three main types
  • Sequence
  • Selection
  • Iteration
  • Note You should have been able to draw
    flowcharts or interpret them.
  • Sequence
  • This is when one statement follows another

50
Control Structures
  • Selection
  • This is when the computer will make a decision
    and proceed based on the result of this decision.

51
Selection Statement (I)
  • There are two main ways for a computer to make
    decisions
  • If Statements
  • Case Statements
  • If statements can have a few different forms but
    the general structure is shown below.
  • If Condition1 Then
  • Statements executed if condition 1 true
  • Else If Condition2 Then
  • Statements executed if condition 2 true
  • Else If Condition3 Then
  • Statements executed if condition 3 true
  • Else
  • Statements executed if all above false
  • End If

52
Selection Statement (II)
  • Case statements can be for the same thing, but
    they look slightly different.
  • Select Case Expression
  • Case Criterion 1
  • Statements to be executed when Criterion 1
    matched
  • Case Criterion 2
  • Statements to be executed when Criterion 2
    matched
  • Case Criterion 3
  • Statements to be executed when Criterion 3
    matched
  • Case Else
  • Statements to be executed if none of the above
    matched
  • End Select

53
Control Structures
  • Iteration
  • This control structure tells the computer to do
    something a number of times.
  • Determinate loops
  • Repeating a section of code a specific number of
    times
  • Indeterminate loops
  • Repeating while a condition is true
  • Repeating until a condition is true

54
Determinate Loops
  • For loops repeat something a preset number of
    times.
  • Useful for populating or working with arrays.
  • For i 0 To 4
  • Print WeekDays(i)
  • Next I

55
Indeterminate Loops (I)
  • Do and while loops these loops are executed
    based on the result of a test.

56
Indeterminate Loops (II)
  • Do and until loops these loops are executed
    based on the result of a test.

Repeats until the condition is true. Loop is
never executed if condition is true initially
Do Until condition Statements Loop
Do Statements Loop Until condition
Repeats until the condition is true. Loop is
executed at least once
57
Arrays and Loops
  • In VB we could create an array of data.
  • Dim someArray(1 To 10) As Integer
  • We could use For..Next Loops to carry out
    operations on arrays.
  • For i 1 to 10
  • someArray(i) 0
  • Next i
  • This will go through each element of the array
    and assign 0 to that element.

58
Multidimensional Arrays and Nested Loops
  • We can create a matrix type structure using a
    multidimensional array.
  • Dim NewArray(1, 2) As Integer
  • To carry out operations on such an array we need
    to use nested loops (loops inside each other).
  • For i 0 To 2
  • For j 0 To 1
  • Next j
  • Next i

59
Programming Procedures
  • Procedures
  • Different types
  • Event procedure
  • VB procedure
  • Sub procedure
  • Function procedure
  • Scope
  • Private
  • Public
  • parameter passing
  • call-by-reference
  • call-be-value

60
Summary
  • This lecture has given an overview about the
    module, introduced the fundamentals of a computer
    system.
  • The tutorial will refresh the basic VB concepts
    through reading notes.
  • The practical session will refresh the use of
    these basic VB concepts in three exercises.
  • Further reading on computer architecture is
    expected. An online book is available here
    http//www.ipp.mpg.de/de/for/bereiche/stellarator/
    Comp_sci/CompScience/csep/csep1.phy.ornl.gov/ca/ca
    .html
Write a Comment
User Comments (0)
About PowerShow.com