1 Input Process Output Programming Right from the

  • Slides: 26
Download presentation
1 Input Process Output Programming Right from the Start with Visual Basic. NET 1/e

1 Input Process Output Programming Right from the Start with Visual Basic. NET 1/e

Objectives • Distinguish between logic and syntax • Understand use the input statement •

Objectives • Distinguish between logic and syntax • Understand use the input statement • Understand use the assignment statement • Understand use the output statement Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 2

Objectives (cont. ) • Understand use arithmetic operators with precedence • Successfully write program

Objectives (cont. ) • Understand use arithmetic operators with precedence • Successfully write program solutions that require input, processing, and output Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 3

1 -1 Logic and Syntax • A computer program is a solution to a

1 -1 Logic and Syntax • A computer program is a solution to a problem. • An algorithm is the logical design used to accomplish a specific objective. • The Visual Logic Development System combines the utility of flowcharts and pseudocode with computer simulation. Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 4

1 -1 Logic and Syntax (cont. ) • Syntax refers to the specific rules

1 -1 Logic and Syntax (cont. ) • Syntax refers to the specific rules of a programming language. • An information system is a combination of people and technology that collect, organize, and process data to produce information. Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 5

1 -1 Logic and Syntax (cont. ) • An information system must do at

1 -1 Logic and Syntax (cont. ) • An information system must do at least three things: – input data into the system – process data within the system – output resulting information from the system Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 6

1 -2 “Hello World” Crews/Murphy – Programming Right from the Start with Visual Basic.

1 -2 “Hello World” Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 7

1 -2 “Hello World” (cont. ) Crews/Murphy – Programming Right from the Start with

1 -2 “Hello World” (cont. ) Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 8

1 -2 “Hello World” (cont. ) Crews/Murphy – Programming Right from the Start with

1 -2 “Hello World” (cont. ) Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 9

1 -3 Input Statements • An input statement accepts data from the user and

1 -3 Input Statements • An input statement accepts data from the user and stores that data into a variable. • A variable is a storage location that can be accessed and changed by developer code. Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 10

1 -3 Input Statements (cont. ) Crews/Murphy – Programming Right from the Start with

1 -3 Input Statements (cont. ) Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 11

1 -3 Input Statements (cont. ) Crews/Murphy – Programming Right from the Start with

1 -3 Input Statements (cont. ) Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 12

Simple Programming Formats Crews/Murphy – Programming Right from the Start with Visual Basic. NET

Simple Programming Formats Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 13

1 -4 Weekly Paycheck Program The weekly paycheck program has two input variables: Hours

1 -4 Weekly Paycheck Program The weekly paycheck program has two input variables: Hours and Rate Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 14

1 -5 Assignment Statements • The assignment statement can be used to perform a

1 -5 Assignment Statements • The assignment statement can be used to perform a calculation and store the result. • An expression is a value-returning code element, such as a variable or mathematical formula. Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 15

How to Write Arithmetic Expressions Crews/Murphy – Programming Right from the Start with Visual

How to Write Arithmetic Expressions Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 16

How to Write Arithmetic Expressions (cont. ) Crews/Murphy – Programming Right from the Start

How to Write Arithmetic Expressions (cont. ) Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 17

1 -6 Output Statements • Types of output include – Screen output – Printed

1 -6 Output Statements • Types of output include – Screen output – Printed output – Sound output – Saving to storage devices Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 18

1 -6 Output Statements (cont. ) Crews/Murphy – Programming Right from the Start with

1 -6 Output Statements (cont. ) Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 19

1 -6 Output Statements (cont. ) Crews/Murphy – Programming Right from the Start with

1 -6 Output Statements (cont. ) Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 20

Intrinsic Functions • Intrinsic functions are predefined commands that provide developers with common, helpful

Intrinsic Functions • Intrinsic functions are predefined commands that provide developers with common, helpful functionality. Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 21

Intrinsic Functions (cont. ) Crews/Murphy – Programming Right from the Start with Visual Basic.

Intrinsic Functions (cont. ) Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 22

1 -7 Debugging with Visual Logic • A programming mistake is often called a

1 -7 Debugging with Visual Logic • A programming mistake is often called a bug. Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 23

Chapter Summary • Variables are storage locations used for holding input and processing information.

Chapter Summary • Variables are storage locations used for holding input and processing information. • Each variable has two components: its name and its value. • Input statements are used to get data into variables. • Expressions are value-returning code elements. Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 24

Chapter Summary (cont. ) • Assignment statements are used to perform calculations and store

Chapter Summary (cont. ) • Assignment statements are used to perform calculations and store the result. • Output statements are used to display information. • Input, assignment, and output statements are sufficient to write small programs. Crews/Murphy – Programming Right from the Start with Visual Basic. NET 1/e – © 2004 Prentice Hall 25

1 Input Process Output Programming Right from the Start with Visual Basic. NET 1/e

1 Input Process Output Programming Right from the Start with Visual Basic. NET 1/e