0% found this document useful (0 votes)
16 views

JK VB NET 1 Introduction To Visual Basic NET Background and Perspective

2024 2025 Hfs 2229 Forensic Quality Management System Course Outline

Uploaded by

curtisandrea242
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

JK VB NET 1 Introduction To Visual Basic NET Background and Perspective

2024 2025 Hfs 2229 Forensic Quality Management System Course Outline

Uploaded by

curtisandrea242
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 41

Introduction to Visual

Basic .NET: Background and


Perspective
Objectives
• Learn basic computer terminology and
component architecture

• Explore the history of programming languages

• Recognize the similarities between


programming languages and spoken languages

• Solve problems and develop algorithms

2
Objectives (continued)
• Identify basic object-oriented programming
concepts

• Examine the benefits of the object-oriented


approach

3
Understanding Basic Computer
Terminology And Component
Architecture
• Understand basic computer terms

• Fundamentals of how computer works

• Computer requires:
• Hardware

• Software

4
Understanding Basic Computer
Terminology And Component
Architecture (continued)
• Hardware

– Physical components of computer

• Architecture

– Arrangement of hardware components within


computer

5
Computer Systems: Computer Hardware and Software

Hardware
Central
Processing
Unit
Input Output
Device Device
Main
Memory

Secondary
Storage
Software

Software refers to the programs that run on a computer.

Two categories of software:


1.Operating system (OS)
A set of programs that manage the computer’s hardware
devices and control their processes.
Examples: Windows Vista, Mac OS X, Linux.
2.Application software
Programs that make the computer useful to the user.
Examples: Microsoft Word, Adobe PDF Reader
Programs and Programming Languages

What is a program?

A computer program is a set of instructions that enables the


computer to solve a problem or perform a task.

The program steps are called an algorithm.


Main Memory

• Commonly referred to as Random Access Memory (RAM)


• Is an ordered sequence of storage cells, each capable of
holding a piece of data.
• Each memory cell has a distinct address.
• The information held can be input data, computed values, or
program instructions, which are represented in combination
of 0s or 1s. This is so-called binary representation.
• The information stored in RAM is volatile.
Secondary Storage

•A nonvolatile storage medium


•Contents retained while power is off
•Hard disk drives are most common
•Records data magnetically on a circular disk
•Provides fast access to large amounts of data
•Optical devices store data on CD’s as pits
•USB flash memory devices
•High capacity device plugs into USB port
•Portable, reliable, and fits easily in a pocket
Input Device

•Any type of device that provides data to a computer from


the outside world
•For example:
•Keyboard
•Mouse
•Scanner
Output Devices

•Any type of device that provides data from a computer to the


outside world
•Examples of output data:
•A printed report
•An image such as a picture
•A sound
•Common output devices include:
•Monitor (display screen)
•Printer
Programming Languages

•The steps in our algorithm must be stated in a form the


computer understands
•The CPU processes instructions as a series of 1’s and 0’s
called machine language
•This is a tedious and difficult format for people
•Instead, programming languages allow us to use words
instead of numbers
•Software converts the programming language statements to
machine language
History of Programming Languages

Machine Languages

Computer hardware consists of microelectronic switches,


which can be switched on or off. The on/off switch status can
be represented using binary 1 and 0.

Example of machine language code:


0010 1100 0110 0000
Machine language is CPU type-dependent. That is, every type
of CPU has its own machine language.

Machine languages are low-level programming languages.


Low-level Programming Languages

Assembly Languages

Assembly languages use mnemonics in place of the 0s and 1s


in programs. It is common to see that the mnemonic ADD is
used to represent the add operation. For example,

ADD bx, ax

In order to execute a program written in Assembly language,


the program should be first converted into a machine language
program using an Assembler, which is also a program.

Assembly languages are low-level languages and are CPU


type-dependent.
High-Level Programming Languages

High-level program languages more resemble English language than low-level languages. Examples:

• Visual Basic • C#
• Python • C
• Javascript • C++
• Java • PHP

• Visual Basic is not just a programming language


• It’s a programming environment with tools to:
• Create screen elements
• Write programming language statements
High-Level Languages (cont’d)

High-level languages allow programmers to write programs in a


more readable form. For example:

grossPay = hours * rate

Programs written in high-level languages should be converted


into machine languages using interpreters or compilers.

An interpreter translates a program from high-level language


into machine language line by line during program execution.

A compiler translates a program into machine language in its


entirety before executing the complied program.
Language Portability

Low-level languages are CPU-dependent, thus they are not


portable.

High-level languages are not CPU-dependent, thus they are


portable. Compilers that work for specific types of computer
systems made the high-level language portable.
High-level Languages
(continued)
• Compiler
– Translate program to machine code
• Linker
– Combines object code with other programs in class
libraries
• Loader
– Loads object code into memory
– Executes program

19
High-level Languages (continued)
• Source code refers to the program written in a high-level
language.

• Object code is the machine language version of the source


code.
• Executable code is created from the object code and
necessary software library components. The executable
code is ready to be run on an operating system.
• In Microsoft Windows operating system, a file with file
types of .exe holds the executable code.
• Class library Collection of object files

– Support features and functions of a high-level language

20
21
Learning a Programming Language
• Understand basic vocabulary
• Keywords
– Words built into language
– Also called reserved words
• Statements
– Consist of:
• Keywords- Words with special meaning to Visual Basic (e.g.,
Private, Sub
• Identifiers - Names created by the programmer (e.g.,
sngGrossPay, btnClose)
• Operators: Special symbols to perform common operations
(e.g., +, -, *, and /)
• Comments - Remarks: Comments inserted by the programmer – these
are ignored when the program runs (e.g., any text preceded by a single
quote)

22
Learning a Programming
Language (continued)
• Procedures
– One or more related statements
– Work together to perform specific task
• Modules
– Self-sufficient group of related procedures
– Can combine with other modules to create
applications
23
Learning a Programming
Language (continued)
• Syntax
– Rules of language
– Includes:
• Spelling
• Punctuation
• Grammar
– Each programming language has own unique
syntax and structure

24
Learning a Programming
Language (continued)
• Syntax error

– Mistake in program

• Violates language rules

– Compiler checks for syntax errors

25
Learning a Programming
Language
• Logic error

– Mistake in program

• Executes and produces incorrect result

– Also known as bugs

– Not checked by compiler

26
Solving Problems and
Developing Algorithms
• Computer programming is problem solving
• Problems solved by programs
– Require inputs
– Produce outputs
• Algorithm
– Sequence of steps used to transform input(s) into
desired output(s)
27
28
Programming Models

Two programming models in use:

•Procedural programming - Legacy model


•Constructed as a set of procedures
(operational, functional units)
•Each procedure is a set of instructions
•The Gross Pay computation is a procedure
•Object-oriented programming (OOP) – Modern model
OOP makes code reuse easier
OOP is more suitable for developing complex software
Visual Basic 2010 or 2103 is an object-oriented
programming language.
Identifying Basic
Object-oriented Programming
Concepts
• Procedural programming
– Defining set of steps to transform inputs into
outputs
– Translating steps into code
• Object-oriented programming
– Defining collection of objects that work together to
solve problem
30
Identifying Basic
Object-oriented Programming
Concepts (continued)
• Object-oriented programming languages:
– Becoming more popular
– Examples:
• Java
• VB .NET
• Object
– Thing that has characteristics and behaviors

31
Identifying Basic
Object-oriented Programming
Concepts (continued)
• Attributes
– Characteristics of an object
• Methods
– Behaviors of an object
• Problem domain objects
– Objects specific to problem being solved

32
33
Identifying Basic
Object-oriented Programming
Concepts (continued)
• Message
– Asks object to invoke one of its methods
• Encapsulation
– Attributes and methods of object are packaged into
single unit
– Do not need to know internal structure of object to
send messages to it

34
Identifying Basic
Object-oriented Programming
Concepts (continued)
• Class
– Defines what all objects of group have in common
• Instance
– Specific member of group
– Example:
• WeaverBird is an instance of the Bird class

35
Identifying Basic
Object-oriented Programming
Concepts (continued)
• Inheritance

– Class of objects takes on characteristics of another


class
• Extends them as necessary

– Subclasses

– Superclass
36
37
Identifying Basic
Object-oriented Programming
Concepts (continued)
• Polymorphism

– Different objects can respond in own way to same


message

– Related to inheritance of methods

38
Examining the Benefits of the
Object-oriented Approach
• Advantages:

– Naturalness

– Reusability

• OO approach still requires algorithm design:

– To define methods of object

39
Summary
• Computer consists of:
– Hardware
– Software
• Programming languages:
– Machine language
– Assembly language
– High-level languages

40
Summary (continued)
• Object-oriented programming
– Defines a collection of objects that work together
to solve a problem

41

You might also like