Lecture Notes 8/24/04 (part 2)

Slides:



Advertisements
Similar presentations
ITEC113 Algorithms and Programming Techniques
Advertisements

Program Design and Development
Understanding the Mainline Logical Flow Through a Program (continued)
Pseudocode.
Lecture Notes 8/30/05 Program Design & Intro to Algorithms.
Pseudocode.
Chapter 3 Planning Your Solution
DCT 1123 Problem Solving & Algorithms
© The McGraw-Hill Companies, 2006 Chapter 1 The first step.
Sw development1 Software Development 1.Define the problem (Analysis) 2.Plan the solution 3.Code 4.Test and debug 5.Maintain and Document.
Introduction to Computational Linguistics Programming I.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 2 Input,
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Chapter 2 Pseudocode. Objectives To introduce common words, keywords and meaningful names when writing pseudocode To define the three basic control structures.
Pseudocode. Simple Program Design, Fourth Edition Chapter 2 2 Objectives In this chapter you will be able to: Introduce common words, keywords, and meaningful.
Pseudocode Simple Program Design Third Edition A Step-by-Step Approach 2.
ITEC113 Algorithms and Programming Techniques
EXERCISES for ALGORITHMS WRITING
Cosc175 - Define Problem/Design Solution/Pseudocode/Trace 1 DEFINE THE PROBLEM.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
JavaScript 101 Lesson 3: Variables and Arithmetic.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake An Introduction to Programming.
The Hashemite University Computer Engineering Department
I’m Thinking of a Number
Lecture Notes 1/20/05 Pseudocode.  Pseudocode standard which we will follow in this class: - Statements are written in simple English; - Each instruction.
Any questions on today’s homework? (Section 1.3B) Reminder: You should be doing this homework without using a calculator, because calculators can’t be.
CompSci 230 S Programming Techniques
Starter What does the following code do?
Chapter 3 Program Design
Topics Designing a Program Input, Processing, and Output
A Playful Introduction to Programming by Jason R. Briggs
Arithmetic Operators Topics Arithmetic Operators Operator Precedence
Chapter 1: Introduction to computers and C++ Programming
Programming Fundamental
DDC 1023 – Programming Technique
Any questions on today’s homework. (Section 1
Assignment statement:
Arithmetic operations & assignment statement
Variables, Expressions, and IO
Introduction To Flowcharting
Computer Programming: C language
Each instruction on a separate line
CHAPTER 2 & 3: Pseudocode and Developing and Algorithm
ALGORITHMS AND FLOWCHARTS
Designing and Debugging Batch and Interactive COBOL Programs
Pseudocode.
ALGORITHMS AND FLOWCHARTS
Introduction to Algorithms and Programming
Faculty of Computer Science & Information System
Topics Designing a Program Input, Processing, and Output
Topics Designing a Program Input, Processing, and Output
Alternate Version of STARTING OUT WITH C++ 4th Edition
CS150 Introduction to Computer Science 1
Core Objects, Variables, Input, and Output
CS150 Introduction to Computer Science 1
Spreadsheets, Modelling & Databases
Chapter 3: Selection Structures: Making Decisions
Boolean Expressions to Make Comparisons
Topics Designing a Program Input, Processing, and Output
Engineering Problem Solving with C++ An Object Based Approach
Engineering Problem Solving with C++ An Object Based Approach
Topics Designing a Program Input, Processing, and Output
Just Basic Lessons 7&8 Mr. Kalmes.
Chapter 3: Selection Structures: Making Decisions
Just Basic Lessons 7 Mr. Kalmes.
Hardware is… Software is…
COMPUTING.
Introduction to Programming
Introduction to Pseudocode
Presentation transcript:

Lecture Notes 8/24/04 (part 2)

Pseudocode (review) Pseudocode standard which we will follow in this class: - Statements are written in simple English; - Each instruction is written on a separate line; - Each set of instructions is written from top to bottom, with only one entry and one exit; - Groups of statements may be formed into modules, and that group given a name.

How to Write Pseudocode 6 basic computer operations: receive information put out information perform arithmetic assign a value to a variable or memory location compare two variables and select one of two alternative actions repeat a group of actions

Receive Information A computer generally gets information in one of the following ways: From a file Pseudocode -> “Read” From a keyboard Pseudocode -> “Get”

Receive Information Examples: Get file name Read first line from the file Get number of students Read the names of the students from the file

Put Out Information A computer generally outputs information in one of the three ways: Print on a printer “Print” Write to a file “Write” Display on a monitor “Display”

Put Out Information Examples: Print “Hello everyone!” Write “My first homework” to hw_1.txt Display average_age

Perform Arithmetic Either actual mathematical symbols or words can be used: Multiply Length by Width to compute Area Area = Length * Width

Perform Arithmetic Symbols that will be used in this class: Addition + Subtraction - Division / Multiplication * Modulus % Parentheses () Also can use the words : Compute and Calculate

Example Write the pseudocode for calculating the average age of the students in our class. Prompt the user for number of students Get number of students Prompt for all of the ages Get the ages of all students Add all ages together to obtain Total_Age Divide Total_Age by the number of students Display the result