Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

Introduction to Flowcharting
Introduction to Flowcharting
Programming Logic and Design Fourth Edition, Introductory
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.
COSC 120 Computer Programming
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
If You Missed Last Week Go to Click on Syllabus, review lecture 01 notes, course schedule Contact your TA ( on website) Schedule.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Sixth Edition by Tony Gaddis, Judy Walters,
Chapter 2: Input, Processing, and Output
CS101- Lecture 11 CS101 Fall 2004 Course Introduction Professor Douglas Moody –Monday – 12:00-1:40 – – –Web Site: websupport1.citytech.cuny.edu.
Chapter 2: Developing a Program Extended and Concise Prelude to Programming Concepts and Design Copyright © 2003 Scott/Jones, Inc.. All rights reserved.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 9 – Income Tax Calculator Application: Introducing.
Chapter 3 Planning Your Solution
(C)opyright 2003 Scott/Jones Publishers Introduction to Flowcharting A Supplement to Starting Out with C++, 4th Edition by Tony Gaddis Scott/Jones Publishers.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
CS102 Introduction to Computer Programming
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter Introduction to Computers and Programming 1.
Simple Program Design Third Edition A Step-by-Step Approach
CIS Computer Programming Logic
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Copyright © 2012 Pearson Education, Inc. Chapter 1 Introduction to Computing and Programming.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 2 Input,
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
Input, Output, and Processing
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 5 – Dental Payment Application: Introducing.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
1 Program Planning and Design Important stages before actual program is written.
Copyright © 2011 Pearson Addison-Wesley What is a Program Made Of? Keywords (Reserved Words) – Words with special meaning that make up a high-level programming.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
CS 100 Introduction to Computing Seminar September 21, 2015.
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 2 Input,
The Hashemite University Computer Engineering Department
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Chapter 2: Input, Processing, and Output Starting Out with Programming Logic & Design by Tony Gaddis (with instructor modifications) 1-1.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Chapter 1: Introduction to Computers and Programming.
CHAPTER 3 COMPLETING THE PROBLEM- SOLVING PROCESS AND GETTING STARTED WITH C++ An Introduction to Programming with C++ Fifth Edition.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
CIS 115 All Exercises Devry University (Devry) FOR MORE CLASSES VISIT CIS 115 All Exercises Devry University.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Algorithms and Flowcharts
Topics Designing a Program Input, Processing, and Output
Input and Output Upsorn Praphamontripong CS 1110
Chapter 2: Input, Processing, and Output
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Topics Designing a Program Input, Processing, and Output
Topics Designing a Program Input, Processing, and Output
Chapter 2: Input, Processing, and Output
Programming Logic and Design Eighth Edition
Presentation transcript:

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis Chapter 2: Input, Processing, and Output

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1-2 Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types 2.5 Named Constants 2.6 Hand Tracing a Program 2.7 Documenting a Program

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Designing a Program 1.The first step in programming is designing – flowcharts and pseudocode help with this process. 2.Next, the code is written. 3.All code must be cleared of all syntax errors. 4.After the executable is created, it can be checked for logic errors. 5.If logic errors exist, the program must be debugged.

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Designing a Program The purpose of Programming Logic and Design is to focus on Flowcharts and Pseudocode. The design is the foundation of a good program. Figure 2-1 The program development cycle

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Designing a Program Two steps in designing a program 1.Understand the tasks that the program is to perform. Learning what the customer wants. 2.Determine the steps that must be taken to perform the task. Create an algorithm, or step-by-step directions, to solve the problem. Use flowcharts and/or pseudocode to solve.

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Class Research: 15 minutes for each team to research 5 minutes for each team to present Use your books, the internet and the ITT Tech Virtual Library to determine: What is pseudocode? What is a flowchart? What are each used for? Discuss pros and cons of each 1-6

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Designing a Program Pseudocode Fake code used as a model for programs No syntax rules Well written pseudocode can be easily translated to actual code Display “Enter the number of hours” Input hours Display “Enter the hourly pay rate” Input payRate Set grossPay = hours * payRate Display “The gross pay is $”, grossPay

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Designing a Program Flowcharts A diagram that graphically depicts the steps that take place in a program Terminator used for start and stop Parallelogram used for input and output Rectangle used for processes Figure 2.2 Flowchart for the pay calculating program

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Output, Input, and Variables Output – data that is generated and displayed Input – data that a program receives Variables – storage locations in memory for data Computer programs typically follow 3 steps 1.Input is received 2.Some process is performed on the input 3.Output is produced

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Output, Input, and Variables Display is the keyword to show output to the screen Sequence – lines execute in the order they appear String Literals – a sequence of characters Figure 2-5 Output of Program 2-1 Figure 2-4 The statements execute in order

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Output, Input, and Variables Input is the keyword to take values from the user of the program It is usually stored in variables

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley BREAK 10 minutes 1-12

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Output, Input, and Variables Programmers can define variable names following certain rules –Must be one word, no spaces –Generally, punctuation characters are avoided –Generally, the first character cannot be a number –Name a variable something that indicates what may be stored in it camelCase is popular naming convention

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Variable Assignment & Calculations Variable assignment does not always have to come from user input, it can also be set through an assignment statement Set price = 20

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Variable Assignment & Calculations Calculations are performed using math operators The expression is normally stored in variables Set sale = price – discount Table 2-1 Common math operators

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley BREAK 10 minutes 1-16

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Multiple Choice Review Questions Take good notes. Some of these questions might show up on the mid-term. 1-17

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 1 A ______ error does not prevent the program from running, but causes it to produce incorrect results. a.syntax b.hardware c.logic d.fatal 1-18

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 1 A ______ error does not prevent the program from running, but causes it to produce incorrect results. a.syntax b.hardware c.logic d.fatal 1-19

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 2 A ______ is a single function that the program must perform in order to satisfy the customer. a.task b.software requirement c.prerequisite d.predicate 1-20

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 2 A ______ is a single function that the program must perform in order to satisfy the customer. a.task b.software requirement c.prerequisite d.predicate 1-21

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 3 A(n) ______ is a set of well-defined logical steps that must be taken to perform a task. a.logarithm b.plan of action c.logic schedule d.algorithm 1-22

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 3 A(n) ______ is a set of well-defined logical steps that must be taken to perform a task. a.logarithm b.plan of action c.logic schedule d.algorithm 1-23

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 4 An informal language that has no syntax rules, and is not meant to be compiled or executed is called ______. a.faux code b.pseudocode c.java d.a flowchart 1-24

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 4 An informal language that has no syntax rules, and is not meant to be compiled or executed is called ______. a.faux code b.pseudocode c.java d.a flowchart 1-25

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 5 A ______ is a diagram that graphically depicts the steps that take place in a program. a.flowchart b.step chart c.code graph d.program graph 1-26

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 5 A ______ is a diagram that graphically depicts the steps that take place in a program. a.flowchart b.step chart c.code graph d.program graph 1-27

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 6 A(n) ______ is a set of statements that execute in the order that they appear. a.serial program b.sorted code c.sequence structure d.ordered structure 1-28

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 6 A(n) ______ is a set of statements that execute in the order that they appear. a.serial program b.sorted code c.sequence structure d.ordered structure 1-29

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 7 A ______ is a sequence of characters that is used as data. a.sequence structure b.character collection c.string d.text block 1-30

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 7 A ______ is a sequence of characters that is used as data. a.sequence structure b.character collection c.string d.text block 1-31

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 8 A ______ is a storage location in memory that is represented by a name. a.variable b.register c.ram slot d.byte 1-32

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 8 A ______ is a storage location in memory that is represented by a name. a.variable b.register c.ram slot d.byte 1-33

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 9 A ______ is any hypothetical person that is using a program and providing input to it. a.designer b.user c.guinea pig d.test subject 1-34

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 9 A ______ is any hypothetical person that is using a program and providing input to it. a.designer b.user c.guinea pig d.test subject 1-35

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 10 A(n) ______ is a message that tells (or asks) the user to enter a specific value. a.inquiry b.input statement c.directive d.prompt 1-36

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Question 10 A(n) ______ is a message that tells (or asks) the user to enter a specific value. a.inquiry b.input statement c.directive d.prompt 1-37

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Unit 2 Homework Short Answer Review Questions 1-4 on page 71 of the textbook Algorithm Workbench Review Questions 1 & 2 on page 71 of the textbook Programming Exercises Questions 1 & 4 starting on page 72 of the textbook DUE NEXT WEEK 1-38

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley BREAK 10 minutes 1-39

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Preparing Your Laptop for the Course Passport device should be divided into 4 partitions for: –Your own files (200GB) –Windows (100GB) –Linux (100GB) –Windows 2008 Server (100GB) 1-40

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Preparing Your Laptop for the Course (cont) Copy VMPlayer files to Passport devices See VM Player instruction sheet (PT1420.U1.TS1) Download vbsetup.exe from Wikispace web site Download Raptor files from Wikispace web site  Autorun.inf  Raptor_Setup.msi  Start_Here.html 1-41

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley BREAK 10 minutes 1-42

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Labs See Lab Manual Handout 2.1 Pseudocode See Lab Manual Handout 2.2 Flowchart See Lab Manual Handout 2.3 Visual Basic 1-43

Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Due Next Week vs Today Due Next Week Unit 2 Research Assignment: Researching Variable Naming Rules (see handout) Unit 2 Homework (see handout) Read the rest of Chapter 2 (pp ) Due today Lab 2.1, Lab 2.2, and Lab