Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.

Similar presentations


Presentation on theme: "Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design."— Presentation transcript:

1 Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design

2 Visual Basic.NET Programming: From Problem Analysis to Program Design2 Understanding Basic Computer Terminology And Component Architecture Every Computer requires: Hardware –Physical components of computer Software –Computer programs that are executed by hardwar Architecture –Arrangement of hardware components within computer

3 Visual Basic.NET Programming: From Problem Analysis to Program Design3

4 4 Understanding Basic Computer Terminology And Component Architecture (continued) Primary computer components: –Input/output devices –Central processing unit –Memory

5 Visual Basic.NET Programming: From Problem Analysis to Program Design5 Exploring the History of Programming Languages The earliest programming languages were machine languages. Assembly languages were developed later. High-level languages are the most advances of the three, and are the languages used by programmers today. Visual Basic.NET is a high-level language.

6 Visual Basic.NET Programming: From Problem Analysis to Program Design6 Machine Language Earliest programming languages Consist of only 0’s and 1’s Bit –Binary digit of either 0 or 1 –At machine level, computers only truly understand bits Programming in machine code is difficult, time-consuming, and error-prone.

7 Visual Basic.NET Programming: From Problem Analysis to Program Design7 Assembly Language Requires writing a set of single-step instructions, which are easier for people to read and write compare to machine language. Provides one-to-one correspondence between each machine language instruction and a mnemonic. Mnemonic –Word or character string that represents an instruction Drawback of assembly language: –Unlike machine language, a program written for one computer architecture usually will not run on a different computer architecture

8 Visual Basic.NET Programming: From Problem Analysis to Program Design8 High-level Languages Very powerful Easier to read, write, and maintain Enable you to develop sophisticated applications with relative ease Less efficient in terms of: –CPU time: takes longer time to execute the program –Memory: take more memory space

9 Visual Basic.NET Programming: From Problem Analysis to Program Design9 High-level Languages (continued) High-level Languages require additional software to prepare the program to execute: – Compiler: translates program to machine code –Linker: combines code with other programs in class libraries –Loader: loads code into memory and executes the program

10 Visual Basic.NET Programming: From Problem Analysis to Program Design10 High-level Languages (continued) Source code –Program written by a programmer Class library –Collection of files (pre-written programs)

11 Visual Basic.NET Programming: From Problem Analysis to Program Design11

12 Visual Basic.NET Programming: From Problem Analysis to Program Design12 Learning a Programming Language Understand basic vocabulary Keywords –Words built into language –Also called reserved words Statements –Consist of: Keywords Identifiers Symbols (Read p.8 of the textbook)

13 Visual Basic.NET Programming: From Problem Analysis to Program Design13 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

14 Visual Basic.NET Programming: From Problem Analysis to Program Design14 Learning a Programming Language (continued) Syntax –Rules of language –Includes: Spelling Punctuation Grammar –Each programming language has own unique syntax and structure

15 Visual Basic.NET Programming: From Problem Analysis to Program Design15 Learning a Programming Language (continued) Syntax error –Mistake in program Violates language rules –Compiler checks for syntax errors

16 Visual Basic.NET Programming: From Problem Analysis to Program Design16 Learning a Programming Language Logic error –Mistake in program logic Executes and produces incorrect result –Also known as bugs –Not checked by compiler

17 Visual Basic.NET Programming: From Problem Analysis to Program Design17 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)

18 Visual Basic.NET Programming: From Problem Analysis to Program Design18

19 Visual Basic.NET Programming: From Problem Analysis to Program Design19 Solving Problems and Developing Algorithms (continued) It’s critical that programmers embrace problem- solving approach Before writing code, programmer must: –Understand problem at hand –Properly identify inputs and outputs –Develop transformation algorithm

20 Visual Basic.NET Programming: From Problem Analysis to Program Design20 Solving Problems and Developing Algorithms (continued) (Review Example 1-1 on p. 11-13 and practice writing the algorithm and desk-checking) Desk-checking: –Draw columns by hand that correspond to items in algorithm –Create set of test data –Step through algorithm –Record changing values for each item

21 Visual Basic.NET Programming: From Problem Analysis to Program Design21 Example 1-2: Desk-Checking the Algorithm

22 Visual Basic.NET Programming: From Problem Analysis to Program Design22 Example 1-2: Desk-Checking the Algorithm (continued)

23 Visual Basic.NET Programming: From Problem Analysis to Program Design23 Identifying Basic Object-oriented Programming Concepts Procedural programming (used mostly in the past) –Defining set of steps to transform inputs into outputs –Translating steps into code Object-oriented programming (used by VB.NET and other high-level programming languages) –Defining collection of objects that work together to solve problem –Becoming more popular

24 Visual Basic.NET Programming: From Problem Analysis to Program Design24 Identifying Basic Object-oriented Programming Concepts (continued) Object –Thing that has characteristics (attributes) and behaviors (methods) Attributes –Characteristics of an object Methods –Behaviors of an object Problem domain objects –Objects specific to problem being solved

25 Visual Basic.NET Programming: From Problem Analysis to Program Design25

26 Visual Basic.NET Programming: From Problem Analysis to Program Design26 Identifying Basic Object-oriented Programming Concepts (continued) Class (e.g. food) –Defines what all objects of a group have in common Instance (e.g. Cheeseburger) –Specific member of the group (the class) Example: –Cheeseburger is an instance of food class

27 Visual Basic.NET Programming: From Problem Analysis to Program Design27 Identifying Basic Object-oriented Programming Concepts (continued) Inheritance –Class of objects takes on characteristics of another class –Subclasses –Superclass

28 Visual Basic.NET Programming: From Problem Analysis to Program Design28

29 Visual Basic.NET Programming: From Problem Analysis to Program Design29 Examining the Benefits of the Object-oriented Approach Advantages: –Naturalness: people find it natural to define a problem (and write a program) in terms of the objects that are familiar to them (e.g. organize items/objects in a hierarchy) –Reusability: classes and objects can be created once and used many times

30 Visual Basic.NET Programming: From Problem Analysis to Program Design30 Summary Computer consists of: –Hardware –Software Programming languages: –Machine language –Assembly language –High-level languages

31 Visual Basic.NET Programming: From Problem Analysis to Program Design31 Summary (continued) Writing a program: –Understand problem –Develop algorithm –Desk-check –Write code Object-oriented programming –Defines a collection of objects that work together to solve a problem


Download ppt "Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design."

Similar presentations


Ads by Google