210 likes | 265 Views
Introduction to Visual Basic and Object Oriented Programming. Important Information. Visual Studio 2015/2017 www.visualstudio.com Course web site http://www.condesigns.com Contact Office Hours – Upon request E-mail: adepinto@gmail.com. Introduction.
E N D
Introduction to Visual Basic and Object Oriented Programming
Important Information • Visual Studio 2015/2017 • www.visualstudio.com • Course web site • http://www.condesigns.com • Contact • Office Hours – Upon request • E-mail: adepinto@gmail.com
Introduction • Computers process data under the control of sequences of instructions called computer programs. • These programs guide the computer through actions specified by people called computer programmers. • The programs that run on a computer are referred to as software.
Data Hierarchy • Data items processed by computers form a data hierarchy that becomes larger and more complex in structure as we progress from the simplest data items (called “bits”) to richer data items, such as characters, fields, and so on.
Data Hierarchy • Bits - The smallest data item in a computer can assume the value 0 or the value 1. • Characters - We prefer to work with decimal digits (0–9), uppercase letters (A–Z), lowercase letters (a–z), and special symbols. Computers process only 1s and 0s, so every character is represented as a pattern of 1s and 0s.
Data Hierarchy • Fields - Just as characters are composed of bits, fields are composed of characters or bytes. A field is a group of characters or bytes that conveys meaning. For example, a field consisting of uppercase and lowercase letters could be used to represent a person’s name, and a field consisting of decimal digits could represent a person’s age.
Data Hierarchy Records Several related fields can be used to compose a record. In a payroll system, for example, the record for an employee might consist of the following fields (possible types for these fields are shown in parentheses): Employee identification number (a whole number) Name (a string of characters) Address (a string of characters) Hourly pay rate (a number with a decimal point) Year-to-date earnings (a number with a decimal point) Amount of taxes withheld (a number with a decimal point) Thus, a record is a group of related fields.
Data Hierarchy • Files - A file is a group of related records. • Database - A database is a collection of data that’s organized for easy access and manipulation. The most popular database model is the relational database in which data is stored in simple tables. • A table includes records composed of fields. • For example, a table of students might include first name, last name, major, year, student ID number and grade point average fields. • The data for each student is a record, and the individual pieces of information in each record are the fields.
Machine Languages, Assembly Languages and High-Level Languages Machine Languages - Any computer can directly understand only its own machine language, defined by its hardware architecture.Machine languages generally consist of numbers, ultimately reduced to 1s and 0s. Assembly Languages and Assemblers - Machine language too slow and tedious. Assembly language uses abbreviations to represent elementary operations. Translator programs called assemblers convert assembly-language programs to machine language quickly. High-Level Languages, Compilers and Interpreters - developed so single statements could be written to accomplish substantial tasks.Translator programs called compilers convert high-level-language code into machine language code.
Machine Languages, Assembly Languages and High-Level Languages
Visual Basic • Visual Basic evolved from BASIC (Beginner’s All-purpose Symbolic Instruction Code), developed in the mid-1960s at Dartmouth College as a language for introducing novices to fundamental programming techniques. • In the late 1980s and the early 1990s, Microsoft developed its Windows graphical user interface (GUI)—the visual part of the operating system with which users interact.
Visual Basic • With the creation of the Windows GUI, the natural evolution of BASIC was to Visual Basic, introduced by Microsoft in 1991 to make programming Windows apps easier. • Visual Basic 6 was introduced in 1998. It was designed to make programming fast and easy, however it was not intended for building industrial strength apps. • In 2002, Microsoft released Visual Basic .NET—a more robust language that’s appropriate for the most demanding app development tasks.
Microsoft’s .NET • In 2000, Microsoft announced its .NET initiative, a broad vision for using the Internet and the web in the development, engineering, distribution and use of software. • .NET permits developers to create apps in any .NET-compatible language (such as Visual Basic, C# and others). • Part of the initiative includes Microsoft’s ASP.NET technology, which is used to create web apps that users interact with via their web browsers.
Common Language Runtime • The Common Language Runtime (CLR) executes .NET programs and provides functionality to make them easier to develop and debug. • The CLR is a virtual machine (VM)—software that manages the execution of programs and hides from them the underlying operating system and hardware. • The source code for programs that are executed and managed by the CLR is called managed code.
Visual Studio .NET • Included in Visual Studio .NET 2013 • Visual Basic (can also be purchased separately) • Visual C++ • C# (C sharp) • .NET 4.5+ Framework • Visual Studio .NET Editions • Community • Professional • Enterprise
Object-Oriented Programming • Visual Basic .NET is object oriented. • Visual Basic has access to the powerful .NET Framework Class Library—a vast collection of prebuilt components that enable you to develop apps quickly.
Object Terminology Objects, or more precisely the classes objects come from, are essentially reusable software components. There are date objects, time objects, audio objects, video objects, automobile objects, people objects, etc. Objects equate to Nouns. Forms are windows. Controls are components contained inside a form. Properties equate to Adjectives. Color or size of a Form Methods are like Verbs. Typical methods include Close, Show and Clear
Object Terminology In object-oriented programming languages, we create a program unit called a class to house the set of methods that perform the class’s tasks. A class is similar in concept to a car’s engineering drawings, which house the design of an accelerator pedal, steering wheel, and so on. Enables people with little or no knowledge of how engines, braking and steering mechanisms work to drive a car easily.
Object Terminology - Classes Class = Automobile Object = Each individual auto is an object. Object is also an Instance of the automobile class. Properties of Automobile class= make, model, color, year Car.color = Red Methods = start, stop, speedup, slowdown Car.Start(), Car.Stop(), Car.Brake() Pressing Brake causes the car to stop. “How” is hidden though. Events of automobile class = Arrive, Crash