chapter 012013
TRANSCRIPT
-
8/10/2019 Chapter 012013
1/38
Microsoft Visual Basic 2010
ONE
Introduction to Visual Basic 2010 Programming
-
8/10/2019 Chapter 012013
2/38
1
Understand software and computer programs
State the role of a developer in creating computerprograms
Specify the use of a graphical user interface anddescribe an event-driven program
Specify the roles of input, processing, output, anddata when running a program on a computer
Describe the arithmetic operations a computerprogram can perform (+, -, *, /, and ^)
Chapter 1: Introduction to Visual Basic 2010 Programming 2
Objectives
-
8/10/2019 Chapter 012013
3/38
1
Explain the logical operations a computer program can
perform ( equal, less than, greater than, not equal, greaterthan or equal to, less than or equal to)
Define and describe the use of a database
Identify the use of a computer programming language ingeneral, and Visual Basic 2010 in particular
Explain the use of Visual Studio 2010 IDE when developingVisual Basic 2010 programs
Specify the programming languages available for use withVisual Studio 2010 (Visual Basic, C++, C#, F#)
Chapter 1: Introduction to Visual Basic 2010 Programming 3
Objectives
-
8/10/2019 Chapter 012013
4/38
1
Discuss the .NET 4.0 Framework
Explain RAD
Describe classes, objects, and the .NET Framework4.0 class libraries
Explain ADO.NET 4.0, ASP.NET 4.0, MSIL, and CLR
Specify the types of Visual Basic 2010 applications
Chapter 1: Introduction to Visual Basic 2010 Programming 4
Objectives
-
8/10/2019 Chapter 012013
5/38
1
The set of instructions that directs a computer toperform tasks is called computer software, or a
computer program
Chapter 1: Introduction to Visual Basic 2010 Programming5
Introduction
-
8/10/2019 Chapter 012013
6/38
1
Computer hardwareis the physical equipmentassociated with a computer
Chapter 1: Introduction to Visual Basic 2010 Programming 6
Introduction
-
8/10/2019 Chapter 012013
7/38
1Introduction
Chapter 1: Introduction to Visual Basic 2010 Programming 7
The basic function of many
computer programs is toaccept some form of data(sometimes called inputdata) manipulate the data insome manner (sometimes
called processing), andcreate some form of outputdata usable by people orother computers, andstorage
-
8/10/2019 Chapter 012013
8/38
1Introduction
Chapter 1: Introduction to Visual Basic 2010 Programming 8
In order for the computer to
execute a program: Program and data must be
placed in the computersrandom access memory(RAM)
The central processing unit
(CPU)can access theinstructions in the programand the data in RAM toperform activities asdirected by the program
-
8/10/2019 Chapter 012013
9/38
1
Saving, or storing, data refers to placing the data or
software electronically on a storage medium in apersistent form.
Hard disk
Universal Serial Bus (USB) drive
Persistentdata remains available even after thecomputer power is turned off
Chapter 1: Introduction to Visual Basic 2010 Programming 9
Introduction
-
8/10/2019 Chapter 012013
10/38
1
A computer program is designed and developed by people
known as computer programmers, or developers Developersare people skilled in designing computer
programs and creating them using programminglanguages
Applicationsmay consist of several computer programsworking together to solve a problem
Computer programmers write the code for programs usinga programming language
Chapter 1: Introduction to Visual Basic 2010 Programming 10
Computer Programmers andDevelopers
-
8/10/2019 Chapter 012013
11/38
1
Chapter 1: Introduction to Visual Basic 2010 Programming 11
Computer Programmers andDevelopers
Comments
Event-HandlerCode
-
8/10/2019 Chapter 012013
12/38
1
Most Visual Basic 2010 programs are event-driven
programsthat communicate with the user through agraphical user interface(GUI)
A GUI usually consists of a window, containing a variety ofobjects (icons, buttons, images)
An eventmeans the user has initiated an action (a mouse
click or entering text) that causes the program to performthe type of processing called for by the users action.
Clicking a button triggers an event, resulting in the programperforming the process called by the click.
Chapter 1: Introduction to Visual Basic 2010 Programming 12
Event-Driven Computer Programswith a Graphical User Interface
-
8/10/2019 Chapter 012013
13/38
1
Examples of events:
The user entersthe account number in the AccountNumber box
The user clicksthe Display Account Balance button
The user clicksthe Reset Window button to clear the
text boxes and prepare the user interface for the nextaccount number
Chapter 1: Introduction to Visual Basic 2010 Programming 13
Event-Driven Computer Programswith a Graphical User Interface
-
8/10/2019 Chapter 012013
14/38
1
Chapter 1: Introduction to Visual Basic 2010 Programming 14
Input Operation
-
8/10/2019 Chapter 012013
15/38
1
Chapter 1: Introduction to Visual Basic 2010 Programming 15
Output Operation
73-0529
$13,432.85
-
8/10/2019 Chapter 012013
16/38
1
In many programs, arithmetic operations are
performed on numeric data to produce useful output Addition
Subtraction
Multiplication
Division Exponentiation
Chapter 1: Introduction to Visual Basic 2010 Programming 16
Basic Arithmetic Operations
-
8/10/2019 Chapter 012013
17/38
-
8/10/2019 Chapter 012013
18/38
1
Chapter 1: Introduction to Visual Basic 2010 Programming 18
Logical Operations: Equal Condition
-
8/10/2019 Chapter 012013
19/38
1
Chapter 1: Introduction to Visual Basic 2010 Programming 19
Logical Operations: Equal Condition
L i l O ti L Th
-
8/10/2019 Chapter 012013
20/38
1Logical Operations: Less Than
Condition
Chapter 1: Introduction to Visual Basic 2010 Programming 20
-
8/10/2019 Chapter 012013
21/38
1Logical Operations: Greater Than Condition
Chapter 1: Introduction to Visual Basic 2010 Programming 21
-
8/10/2019 Chapter 012013
22/38
1
When you develop and write a program, it must be saved
on some type of storage medium (i.e., a disk) When you want the program to run, you can cause the
program to load into RAM and execute it
The program you write also can save data Banking applications must save account data
In most cases, data is stored in a database Collection of data organized in a manner that allows access,
retrieval, and use of that data
However, data can also be saved in a text file
Chapter 1: Introduction to Visual Basic 2010 Programming 22
Saving Software and Data
-
8/10/2019 Chapter 012013
23/38
1
Each program statement causes the computer to perform
one or more operations The developer must follow the syntax, or programming
rules, of the programming language precisely
Many developers use a tool called Visual Studio 2010tocreate Visual Basic 2010 programs
Visual Studio 2010 is a type of integrated developmentenvironment(IDE) Provides services and tools that enable a developer to code,
test, and implement a single program or series of programs
Chapter 1: Introduction to Visual Basic 2010 Programming 23
Visual Basic 2010 and Visual Studio 2010
-
8/10/2019 Chapter 012013
24/38
1
Chapter 1: Introduction to Visual Basic 2010 Programming 24
Visual Studio 2010 IDE and Visual Basic 2010
Form Designer
Soluion Explorer
Properties
Error List
-
8/10/2019 Chapter 012013
25/38
1 Visual Basic
Programming language that allows developers to easilybuild complex Windows and Web programs, as well asother software tools
Based on the BASIC language
C++
Derivative of the programming language, C
Visual C# (pronounced C Sharp)
Synthesis of the elegance and syntax of C++ with many ofthe productivity benefits enjoyed in Visual Basic
Visual F# (pronounced F Sharp)
Multipurpose language known for its math-intensive focus
Chapter 1: Introduction to Visual Basic 2010 Programming 25
Programming Languages
-
8/10/2019 Chapter 012013
26/38
1
.NET technologies and products were designed to
work together to allow businesses to connectinformation, people, systems, and devices throughsoftware
The .NET Frameworkprovides tools and processes
developers can use to produce and run programs Most recent version is .NET Framework 4.0
Chapter 1: Introduction to Visual Basic 2010 Programming 26
.NET Framework 4.0
-
8/10/2019 Chapter 012013
27/38
1.NET Class Library
Chapter 1: Introduction to Visual Basic 2010 Programming 27
A classis a named
group of program code A button is an example
of a class
A class librarystoresthe class and makes the
class available to alldevelopers who needto use it
-
8/10/2019 Chapter 012013
28/38
1
A button created from a class is called an object, or
sometimes an instance of a class The process of creating a Button object from the
Button class is called instantiation
Rapid application development (RAD) refers to the
process of using prebuilt classes to make applicationdevelopment faster, easier, and more reliable
Chapter 1: Introduction to Visual Basic 2010 Programming 28
.NET Class Library
-
8/10/2019 Chapter 012013
29/38
1
ADO.NET 4.0 (ActiveX Data Objects) provides the
functionality for a program to perform four primarytasks when working with a database:
Get the data
Examine the data
Edit the data Update the data
Chapter 1: Introduction to Visual Basic 2010 Programming 29
ADO.NET 4.0
-
8/10/2019 Chapter 012013
30/38
1
ASP.NET 4.0 allows developers to use Visual Studio
2010 to build powerful, sophisticated Webapplications
Almost all .NET framework objects are available inASP.NET 4.0
Easy to deploy a Web application on a Web server
Chapter 1: Introduction to Visual Basic 2010 Programming 30
ASP.NET 4.0
-
8/10/2019 Chapter 012013
31/38
1
Program compilationtranslates programming statements
into instructions that can be understood by the computer Program compilation for a Visual Basic 2010 program
creates a set of electronic code expressed in anintermediate language called the Microsoft IntermediateLanguage (MSIL)
When the program is executed, a portion of .NET 4.0 calledthe Common Language Runtime (CLR)reads the MSIL andcauses the actual instructions within the program to beexecuted
Chapter 1: Introduction to Visual Basic 2010 Programming 31
Microsoft Intermediate Language (MSIL) andCommon Language Runtime (CLR)
-
8/10/2019 Chapter 012013
32/38
1
Chapter 1: Introduction to Visual Basic 2010 Programming 32
Microsoft Intermediate Language (MSIL) andCommon Language Runtime (CLR)
-
8/10/2019 Chapter 012013
33/38
1
Windows application
Program will run on a computer or other device thatsupports the Windows GUI
Mobile application
Designed to run on mobile devices running the Windows
CE operating system Web site application
Uses ASP.NET 4.0 and runs on a Web server
Chapter 1: Introduction to Visual Basic 2010 Programming 33
Types of Visual Basic 2010Applications
-
8/10/2019 Chapter 012013
34/38
-
8/10/2019 Chapter 012013
35/38
1
Understand software and computer programs
State the role of a developer in creating computerprograms
Specify the use of a graphical user interface anddescribe an event-driven program
Specify the roles of input, processing, output, anddata when running a program on a computer
Describe the arithmetic operations a computerprogram can perform
Chapter 1: Introduction to Visual Basic 2010 Programming 35
Summary
-
8/10/2019 Chapter 012013
36/38
1
Explain the logical operations a computer program
can perform Define and describe the use of a database
Identify the use of a computer programminglanguage in general, and Visual Basic 2010 in particular
Explain the use of Visual Studio 2010 when developingVisual Basic 2010 programs
Specify the programming languages available for usewith Visual Studio 2010
Chapter 1: Introduction to Visual Basic 2010 Programming 36
Summary
-
8/10/2019 Chapter 012013
37/38
1
Explain the .NET 4.0 Framework
Explain RAD Describe classes, objects, and the .NET Framework
4.0 class libraries
Explain ADO.NET 4.0, ASP.NET 4.0, MSIL, and CLR
Specify the types of Visual Basic 2010 applications
Chapter 1: Introduction to Visual Basic 2010 Programming 37
Summary
-
8/10/2019 Chapter 012013
38/38
Microsoft Visual Basic 2010
CHAPTER ONE COMPLETEIntroduction to Visual Basic 2010 Programming