Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.

download Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.

of 38

  • date post

    15-Jan-2016
  • Category

    Documents

  • view

    215
  • download

    0

Embed Size (px)

Transcript of Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.

Microsoft Visual Basic 2005 for Windows and Mobile Applications

CHAPTER ONEIntroduction to Visual Basic 2012 ProgrammingMicrosoft Visual Basic 2012 11Chapter 1: Introduction to Visual Basic 2012 Programming2ObjectivesUnderstand software and computer programsState the role of a developer in creating computer programsSpecify the use of a graphical user interface and describe an event-driven programSpecify the roles of input, processing, output, and data when running a program on a computerDescribe the arithmetic operations a computer program can perform12Chapter 1: Introduction to Visual Basic 2012 Programming3ObjectivesExplain the logical operations a computer program can performDefine and describe the use of a databaseIdentify the use of a computer programming language in general, and Visual Basic 2012 in particularExplain the use of Visual Studio 2012 when developing Visual Basic 2012 programsSpecify the programming languages available for use with Visual Studio 201213Chapter 1: Introduction to Visual Basic 2012 Programming4ObjectivesExplain the .NET 4.5 FrameworkExplain RADDescribe classes, objects, and the .NET Framework 4.5 class librariesExplain ADO.NET 4.5, ASP.NET 4.5, MSIL, and CLRSpecify the types of Visual Basic 2012 applications14Chapter 1: Introduction to Visual Basic 2012 Programming5IntroductionThe set of instructions that directs a computer to perform tasks is called computer software, or a computer programA computer program on a mobile device or Windows 8 computer is also called an app

15Chapter 1: Introduction to Visual Basic 2012 Programming6IntroductionComputer hardware is the physical equipment associated with a computer

16Chapter 1: Introduction to Visual Basic 2012 Programming7IntroductionThe basic function of many programs is to accept some form of data (sometimes called input data) manipulate the data in some manner (sometimes called processing), and create some form of data usable by people or other computers (sometimes called output data or information)

17Chapter 1: Introduction to Visual Basic 2012 Programming8IntroductionIn order for the computer to execute a program:Program and data must be placed in the computers random access memory (RAM)The central processing unit (CPU) can access the program instructions and the data in RAM to perform activities as directed by the program

18Chapter 1: Introduction to Visual Basic 2012 Programming9IntroductionSaving, or storing, data refers to placing the data or software electronically on a storage mediumHard diskUniversal Serial Bus (USB) drivePersistent data remains available even after the computer power is turned off19Chapter 1: Introduction to Visual Basic 2012 Programming10IntroductionA computer program is designed and developed by people known as computer programmers, or developersDevelopers are people skilled in designing computer programs and creating them using programming languagesApplications may consist of several computer programs working together to solve a problemDevelopers write the code for programs using a programming language110Chapter 1: Introduction to Visual Basic 2012 Programming11Introduction

111Chapter 1: Introduction to Visual Basic 2012 Programming12Event-Driven Computer Programs with a Graphical User InterfaceMost Visual Basic 2012 programs are event-driven programs that communicate with the user through a graphical user interface (GUI)A GUI usually consists of a window, containing a variety of objectsAn event is an action that the user initiates and causes the program to perform a type of processing in response112Chapter 1: Introduction to Visual Basic 2012 Programming13Event-Driven Computer Programs with a Graphical User InterfaceFor example:The user enters the account number in the Account Number boxThe user clicks the Display Account Balance buttonThe user clicks the Reset Window button to clear the text boxes and prepare the user interface for the next account number

113Chapter 1: Introduction to Visual Basic 2012 Programming14Input Operation

114Chapter 1: Introduction to Visual Basic 2012 Programming15Output Operation

115Chapter 1: Introduction to Visual Basic 2012 Programming16Basic Arithmetic OperationsIn many programs, arithmetic operations are performed on numeric data to produce useful outputAdditionSubtractionMultiplicationDivision

116Chapter 1: Introduction to Visual Basic 2012 Programming17Logical OperationsComputers, through the use of programs, can compare numbers, letters of the alphabet, and special charactersThe program will perform a processing task, based on the result of the comparisonLogical operations:Comparing to determine if two values are equalComparing to determine if one value is greater than another valueComparing to determine if one value is less than another value117Comparing: Equal ConditionChapter 1: Introduction to Visual Basic 2012 Programming18

118Comparing : Equal ConditionChapter 1: Introduction to Visual Basic 2012 Programming19

119Chapter 1: Introduction to Visual Basic 2012 Programming20Comparing: Less Than Condition

120Chapter 1: Introduction to Visual Basic 2012 Programming21Comparing: Greater Than Condition

121Chapter 1: Introduction to Visual Basic 2012 Programming22Saving Software and DataWhen you develop and write a program, it must be saved on a diskWhen you want the program to run, you can cause the program to load into RAM and executeThe program you write also can save dataBanking applications must save account dataIn most cases, data is stored in a databaseCollection of data organized in a manner that allows access, retrieval, and use of that data122Chapter 1: Introduction to Visual Basic 2012 Programming23Visual Basic 2012 and Visual Studio 2012Each program statement causes the computer to perform one or more operationsThe developer must follow the syntax, or programming rules, of the programming language preciselyMost developers use a tool called Visual Studio 2012 to write Visual Basic 2012 programsVisual Studio 2012 is a type of integrated development environment (IDE)Provides services and tools that enable a developer to code, test, and implement a single program or series of programs123Chapter 1: Introduction to Visual Basic 2012 Programming24Visual Basic 2012 and Visual Studio 2012

124Chapter 1: Introduction to Visual Basic 2012 Programming25Programming LanguagesVisual BasicProgramming language that allows developers to easily build complex Windows and Web programs, as well as other software toolsBased on the BASIC languageC++Derivative of the programming language, CVisual C#Synthesis of the elegance and syntax of C++ with many of the productivity benefits enjoyed in Visual BasicJavaScriptOpen source client-side scripting languageVisual F#Multipurpose language known for its math-intensive focus125Chapter 1: Introduction to Visual Basic 2012 Programming26.NET Framework 4.5.NET technologies and products were designed to work together to allow businesses to connect information, people, systems, and devices through softwareThe .NET Framework provides tools and processes developers can use to produce and run programsMost recent version is .NET Framework 4.5126Chapter 1: Introduction to Visual Basic 2012 Programming27.NET Class LibraryA class is a named group of program codeA button is an example of a classA class library stores the class and makes the class available to all developers who need to use it

127Chapter 1: Introduction to Visual Basic 2012 Programming28.NET Class LibraryA button created from a class is called an object, or sometimes an instance of a classThe process of creating a Button object from the Button class is called instantiationRapid application development (RAD) refers to the process of using prebuilt classes to make application development faster, easier, and more reliable128Chapter 1: Introduction to Visual Basic 2012 Programming29ADO.NET 4.5ADO.NET 4.5 (ActiveX Data Objects) provides the functionality for a program to perform four primary tasks when working with a database:Get the dataExamine the dataEdit the dataUpdate the data

129Chapter 1: Introduction to Visual Basic 2012 Programming30ASP.NET 4.5Allows developers to use Visual Studio 2012 to build powerful, sophisticated Web applicationsAlmost all .NET framework objects are available in ASP.NET 4.5Easy to deploy a Web application on a Web server130Chapter 1: Introduction to Visual Basic 2012 Programming31Microsoft Intermediate Language (MSIL) and Common Language Runtime (CLR)Program compilation translates programming statements into instructions that can be understood by the computerProgram compilation for a Visual Basic 2012 program creates a set of electronic code expressed in an intermediate language called the Microsoft Intermediate Language (MSIL)When the program is executed, a portion of .NET 4.5 called the Common Language Runtime (CLR) reads the MSIL and causes the actual instructions within the program to be executed131Chapter 1: Introduction to Visual Basic 2012 Programming32Microsoft Intermediate Language (MSIL) and Common Language Runtime (CLR)

132Chapter 1: Introduction to Visual Basic 2012 Programming33Types of Visual Basic 2012 ApplicationsWindows applicationProgram will run on a computer or other device that supports the Windows GUIWindows Store appDesigned to run on Windows 8 computers and mobile devicesWeb applicationUses ASP.NET 4.5 and runs on a Web server133Types of Visual Basic 2012 ApplicationsOffice applicationAutomates and manipulates documents created using Microsoft Office 2010 and Office 2013Database applicationWritten using ADO.NET 4.5 to reference, access, display, and update data stored in a databaseOther types of applications include console applications, classes for class libraries, certain controls to use in Windows applications, Web services, and device-specific applications

Chapter 1: Introduction