REPRESENTING ALGORITHMS. REPRESENTING ALGORITHMS IB DP Computer science Standard Level ICS3U

Size: px
Start display at page:

Download "REPRESENTING ALGORITHMS. REPRESENTING ALGORITHMS IB DP Computer science Standard Level ICS3U"

Transcription

1 C A N A D I A N I N T E R N A T I O N A L S C H O O L O F H O N G K O N G 2.1 Introduction 2.2 Representing Algorithms algorithm should be clear, precise, and unambiguous one possibility is to use the natural language the familiar written and spoken language the algorithm is easy to read, write, and understand can be extremely verbose, causing the resulting algorithms to be rambling, unstructured, and hard to follow unstructured, free-flowing writing style natural language without any clues to guide the reader, such as indentation, line numbering, locating the beginning of a loop or a condition can be a time-consuming task too rich in interpretation and meaning relies on either context or a reader s experiences to give precise meaning to a word or phrase desirable when writing poetry or fiction but not for writing algorithms which must always execute in the same way and produce identical results 1

2 natural language punctuations, grammar, and syntax are not interpreted age vs Age vs AGE age = 14 as in an assignment or a comparison a notation to design and represent algorithms a set of English language constructs designed to resemble statements in a programming language but that do not actually run on a computer a compromise between the two extremes of natural and formal languages simple, highly readable, and has virtually no grammatical rules it is not a formal language with rigidly standardized syntactic and semantic rules and regulations an informal design notation used solely to express algorithms 2

3 SEQUENTIAL OPERATIONS three basic sequential operations computation set the value of age to 14 set the value of c to ( a + b ) input get a value for age output print the value for age print the message for Hello World! Tasks 1. Write pseudocode versions of an algorithm that gets three data values x, y, and z as input and outputs the average of those three values. 2. Write pseudocode versions of an algorithm that inputs your current credit card balance, the total dollar amount of new purchases, and the total dollar amount of all payments. The algorithm computes the new balance, which includes a 12% interest charge on any unpaid balance. CONDITIONAL and ITERATIVE OPERATIONS for non-sequential operations such as branching and repetition to alter the normal sequential flow of control in an algorithm 3

4 CONDITIONAL OPERATIONS conditional statements are the question-asking operations if time is before 12noon then print the message Good Morning else if time is before 6pm then print the message Good Afternoon else print the message Good Evening CONDITIONAL OPERATIONS conditions are checked from the top to the bottom subsequent alternatives are considered only when the previous ones have not been satisfied ITERATIVE OPERATIONS iterative statements are repetitions and loops two types while iteration for iteration 4

5 ITERATIVE OPERATIONS: while instructions are repeated indefinitely until the terminating condition is reached the instructions may not even begin repeating if the terminating condition is reached before it the iteration begins while speed is less than 100km/h press on the gas pedal ITERATIVE OPERATIONS: do while a variation of the while iteration the instructions are executed once before the terminating condition is checked do press on the gas pedal while speed is less than 100km/h ITERATIVE OPERATIONS: for instructions are repeated within a definite number of iterations for total is less than 10 increment total by 1 5

6 Task Write an if/then/else statement that sets the variable y to the value 1 if x 0. If x < 0, then the statement should set y to the value 2. (Assume x already has a value.) Pg. 50 # 2 Write pseudocode versions of an algorithm that gets the radius r of a circle as input. Its output is both the circumference and the area of a circle of radius r. Pg. 50 # 5 Write pseudocode versions of an algorithm that is given the length and width, in feet, of a rectangular carpet and determines its total cost given that the material cost is $23/square yard. 6

7 Pg. 61 # 2 Write an algorithm that gets as input three data values x, y, and z and outputs the average of these values if the value of x is positive. If the value of x is either zero or negative, your algorithm should not compute the average but should print the error message Bad Data instead. Pg. 61 # 5 Write an algorithm that inputs the length and width, in feet, of a rectangular carpet and the price of the carpet in $/square yard. It then determines if we can afford to purchase this carpet, given that our total budget for carpeting is $500. Pg. 85 # 1 Write pseudocode instructions to carry out each of the following computational operations. 1. Determine the area of a triangle given values for the base b and the height h. 2. Compute the interest earned in 1 year given the starting account balance B and the annual interest rate I and assuming simple interest, that is, no compounding. Also determine the final balance at the end of the year. 3. Determine the flying time between two cities given the mileage M between them and the average speed of the airplane. 7

8 Pg. 85 # 11 Develop an algorithm to compute gross pay. The inputs to your algorithm are the hours worked per week and the hourly pay rate. The rule for determining gross pay is to pay the regular pay rate for all hours worked up to 40, time-and-a-half for all hours over 40 up to 54, and double time for all hours over 54. Compute and display the value for gross pay using this rule. After displaying one value, ask the user whether he or she wants to do another computation. Repeat the entire set of operations until the user says no. 8

Invitation to Computer Science 7th Edition TEST BANK Schneider Gersting

Invitation to Computer Science 7th Edition TEST BANK Schneider Gersting Invitation to Computer Science 7th Edition TEST BANK Schneider Gersting Instant download at: Invitation to Computer Science 7th Edition SOLUTIONS MANUAL Schneider Gersting Instant download at: https://testbankreal.com/download/invitation-computer-science-7th-edition-test-bankschneider-gersting/

More information

[Page 177 (continued)] a. if ( age >= 65 ); cout << "Age is greater than or equal to 65" << endl; else cout << "Age is less than 65 << endl";

[Page 177 (continued)] a. if ( age >= 65 ); cout << Age is greater than or equal to 65 << endl; else cout << Age is less than 65 << endl; Page 1 of 10 [Page 177 (continued)] Exercises 4.11 Identify and correct the error(s) in each of the following: a. if ( age >= 65 ); cout

More information

Chapter 2: Algorithm Discovery and Design. Invitation to Computer Science, C++ Version, Fourth Edition

Chapter 2: Algorithm Discovery and Design. Invitation to Computer Science, C++ Version, Fourth Edition Chapter 2: Algorithm Discovery and Design Invitation to Computer Science, C++ Version, Fourth Edition Objectives In this chapter, you will learn about Representing algorithms Examples of algorithmic problem

More information

Administrativia. CS107 Introduction to Computer Science. Readings. Algorithms. Expressing algorithms

Administrativia. CS107 Introduction to Computer Science. Readings. Algorithms. Expressing algorithms CS107 Introduction to Computer Science Lecture 2 An Introduction to Algorithms: and Conditionals Administrativia Lab access Searles 128: Mon-Friday 8-5pm (unless class in progress) and 6-10pm Sat, Sun

More information

A Quick Review of Chapter 1

A Quick Review of Chapter 1 A Quick Review of Chapter 1 The core of computing is algorithms Algorithm A well-ordered collection of unambiguous and effectively computable operations that, when executed, produces a result and halts

More information

9/23/2013. Chapter 2. Objectives. Introduction. Objectives (continued) Representing Algorithms. Representing Algorithms

9/23/2013. Chapter 2. Objectives. Introduction. Objectives (continued) Representing Algorithms. Representing Algorithms Chapter 2 The Algorithmic Foundations of Computer Science Objectives After studying this chapter, students will be able to: Explain the benefits of pseudocode over natural language or a programming language

More information

Homework #2. If (your ID number s last two digits % 6) = 0: 6, 12, 18

Homework #2. If (your ID number s last two digits % 6) = 0: 6, 12, 18 2005/Sep/19 1 Homework #2 Chapter 1: Exercises 7, 9 with modifications: for Exercise 7.a: 20 and 32 are changed as your ID number s last two digits and 60. for Exercise 9: 47x25 are change as 47x(your

More information

For the test, be sure to show all work! PROBLEMS: ANSWERS: For problems 1 9, simplify the expression ( ) Evaluate if x = -2 and y = 1 8.

For the test, be sure to show all work! PROBLEMS: ANSWERS: For problems 1 9, simplify the expression ( ) Evaluate if x = -2 and y = 1 8. Pre-algebra For the test, be sure to show all work! PROBLEMS: For problems 9, simplify the expression.. 9 ( 7) Ch / Review.. 56 74... 4. 4 7 4. 5. ( 87) + ( ) 5. 6. 6. 7. ( ) + 4 6 5 + 7. Evaluate if x

More information

Algorithm Discovery and Design. Why are Algorithms Important? Representing Algorithms. Chapter 2 Topics: What language to use?

Algorithm Discovery and Design. Why are Algorithms Important? Representing Algorithms. Chapter 2 Topics: What language to use? Algorithm Discovery and Design Chapter 2 Topics: Representing Algorithms Algorithmic Problem Solving CMPUT101 Introduction to Computing (c) Yngvi Bjornsson & Jia You 1 Why are Algorithms Important? If

More information

Algorithms. Abdelghani Bellaachia, CSCI 1121 Page: 1

Algorithms. Abdelghani Bellaachia, CSCI 1121 Page: 1 Algorithms 1. Objectives... 2 2. Design You Solution... 2 3. Structure of an algorithm:... 3 4. Pseudocode:... 4 5. Example... 5 6. Selection or Conditional Execution... 8 7. Looping or Iteration... 9

More information

SNS COLLEGE OF ENGINEERING,

SNS COLLEGE OF ENGINEERING, SNS COLLEGE OF ENGINEERING, COIMBATORE Department of Computer Science and Engineering QUESTION BANK(PART A) GE8151 - PROBLEM SOLVING AND PYTHON PROGRAMMING TWO MARKS UNIT-I 1. What is computer? Computers

More information

Chapter 2. The Algorithmic Foundations of. Computer Science INVITATION TO. Computer Science. Tuesday, September 10, 13

Chapter 2. The Algorithmic Foundations of. Computer Science INVITATION TO. Computer Science. Tuesday, September 10, 13 Chapter 2 The Algorithmic Foundations of Computer Science INVITATION TO Computer Science 1 Objectives After studying this chapter, students will be able to: Explain the benefits of pseudocode over natural

More information

Problem Solving and Algorithms

Problem Solving and Algorithms Problem Solving and Algorithms Problem Solving We do it all the time Approaches: Less successful Grope blindly toward a solution Fail to complete a chain or reasoning Successful Begin with what is understood

More information

Algorithms, Part 2 of 3. Topics Problem Solving Examples Pseudocode Control Structures

Algorithms, Part 2 of 3. Topics Problem Solving Examples Pseudocode Control Structures Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode Control Structures 1 Problem Solving Decode this sentence: Pdeo eo pda yknnayp wjosan. We have just come up with a specific solution to

More information

Chapter 2. Designing a Program. Input, Processing, and Output Fall 2016, CSUS. Chapter 2.1

Chapter 2. Designing a Program. Input, Processing, and Output Fall 2016, CSUS. Chapter 2.1 Chapter 2 Input, Processing, and Output Fall 2016, CSUS Designing a Program Chapter 2.1 1 Algorithms They are the logic on how to do something how to compute the value of Pi how to delete a file how to

More information

This is a function because no vertical line can be drawn so that it intersects the graph more than once.

This is a function because no vertical line can be drawn so that it intersects the graph more than once. Determine whether each relation is a function. Explain. 1. A function is a relation in which each element of the domain is paired with exactly one element of the range. So, this relation is a function.

More information

Algorithms, Part 2 of 3. Problem Solving. Problem Solving (con t) Topics Problem Solving Examples Pseudocode Control Structures

Algorithms, Part 2 of 3. Problem Solving. Problem Solving (con t) Topics Problem Solving Examples Pseudocode Control Structures Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode Control Structures Reading Section 3.3-3.10 (don t worry about understanding the C code, just the pseudocode) Problem Solving Decode this

More information

REVIEW FOR BASIC MATH SKILLS FINAL EXAM (December 2008) (Basic 4-Function, 10-Key Calculator Allowed No Scientific or Graphing Calculators)

REVIEW FOR BASIC MATH SKILLS FINAL EXAM (December 2008) (Basic 4-Function, 10-Key Calculator Allowed No Scientific or Graphing Calculators) REVIEW FOR BASIC MATH SKILLS FINAL EXAM (December 008) (Basic 4-Function, 0-Key Calculator Allowed No Scientific or Graphing Calculators) In order to be prepared for the final exam, students should be

More information

Problem Solving with Decisions. T.Fatin Alhila

Problem Solving with Decisions. T.Fatin Alhila Problem Solving with Decisions 1 Decision Logic Structure - The decision structure is one of the most powerful structures because it is the only way that the computer can choose between two or more sets

More information

SNS COLLEGE OF ENGINEERING

SNS COLLEGE OF ENGINEERING SNS COLLEGE OF ENGINEERING DEPARTMENT OF CSE Presented By Thillaiarasu.N SCRAMBLE 2 Solution 3 What is Pseudocode? 4 Consists of: Short Readable Formally styled English language Used for: Explaining the

More information

Repetition Structures

Repetition Structures Repetition Structures Chapter 5 Fall 2016, CSUS Introduction to Repetition Structures Chapter 5.1 1 Introduction to Repetition Structures A repetition structure causes a statement or set of statements

More information

Condition-Controlled Loop. Condition-Controlled Loop. If Statement. Various Forms. Conditional-Controlled Loop. Loop Caution.

Condition-Controlled Loop. Condition-Controlled Loop. If Statement. Various Forms. Conditional-Controlled Loop. Loop Caution. Repetition Structures Introduction to Repetition Structures Chapter 5 Spring 2016, CSUS Chapter 5.1 Introduction to Repetition Structures The Problems with Duplicate Code A repetition structure causes

More information

For full credit, show all work.

For full credit, show all work. ccelerated Review 7: Linear Equations Name: For full credit, show all work. 1. 2. For the situation described, first write an equation in the form y = mx + b. Then solve the problem. sales associate is

More information

Algorithm Discovery and Design

Algorithm Discovery and Design Algorithm Discovery and Design Chapter 2 The Algorithmic Foundations of Computer Science Algorithms Algorithm Step-by-step method for accomplishing some task Operations used to construct algorithms Sequential,

More information

Mathematics Scope & Sequence Grade 7 Revised: June 2015

Mathematics Scope & Sequence Grade 7 Revised: June 2015 Rational Numbers Mathematics Scope & Sequence 2015-16 Grade 7 Revised: June 2015 First Six Weeks (29 ) 7.3B apply and extend previous understandings of operations to solve problems using addition, subtraction,

More information

UNIT CSEC Multiple Choice Items Sample Paper 01

UNIT CSEC Multiple Choice Items Sample Paper 01 This paper consists of 60 Multiple Choice items from the Core Syllabus according to the following allocation: Section No. of items Computation 6 Number Theory Consumer Arithmetic 8 Sets Measurement 8 Statistics

More information

Page 3 GO ON. 1 The visual representation describes the relationships between the sets and subsets of numbers.

Page 3 GO ON. 1 The visual representation describes the relationships between the sets and subsets of numbers. 043.8th.math.staar2 Some questions (c) 2014 by TEKS Resource System. Some questions (c) 2014 by Progress Testing. Some questions (c) 2014 by Region 10 Educational Service Center. Page 2 1 The visual representation

More information

Geometric Probabiltiy

Geometric Probabiltiy Geometric Probabiltiy Reteaching 101 Math Course 3, Lesson 101 Geometric Probability: The probability based on the area of the regions Probability = Formula: area of included region area of known region

More information

Chapter 2. C++ Basics. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Chapter 2. C++ Basics. Copyright 2014 Pearson Addison-Wesley. All rights reserved. Chapter 2 C++ Basics 1 Overview 2.1 Variables and Assignments 2.2 Input and Output 2.3 Data Types and Expressions 2.4 Simple Flow of Control 2.5 Program Style Slide 2-3 2.1 Variables and Assignments 2

More information

Course Outline. Introduction to java

Course Outline. Introduction to java Course Outline 1. Introduction to OO programming 2. Language Basics Syntax and Semantics 3. Algorithms, stepwise refinements. 4. Quiz/Assignment ( 5. Repetitions (for loops) 6. Writing simple classes 7.

More information

COMP 202 Java in one week

COMP 202 Java in one week CONTENTS: Basics of Programming Variables and Assignment Data Types: int, float, (string) Example: Implementing a calculator COMP 202 Java in one week The Java Programming Language A programming language

More information

2500( ) ( ) ( ) 3

2500( ) ( ) ( ) 3 Name: *Don't forget to use your Vertical Line Test! Mr. Smith invested $,00 in a savings account that earns % interest compounded annually. He made no additional deposits or withdrawals. Which expression

More information

Chapter 5. Algorithms Pearson Addison-Wesley. All rights reserved

Chapter 5. Algorithms Pearson Addison-Wesley. All rights reserved Chapter 5 Algorithms 2007 Pearson Addison-Wesley. All rights reserved Chapter 5: Algorithms 5.1 The Concept of an Algorithm 5.2 Algorithm Representation 5.3 Algorithm Discovery 5.4 Iterative Structures

More information

ACT Diagnostic Review #1

ACT Diagnostic Review #1 Name Date Score ACT Diagnostic Review #1 1. Gabe biked a total of kilometers over the course of his morning and afternoon bike rides. If he biked a distance of in the afternoon? kilometers in the morning,

More information

Programming revision. Revision tip: Focus on the things you find difficult first.

Programming revision. Revision tip: Focus on the things you find difficult first. Programming revision Revision tip: Focus on the things you find difficult first. Task Time (minutes) a 1. Complete self assessment sheet. 2 2. Read through the chapter on programming. 15 3. Work through

More information

Week One: Introduction A SHORT INTRODUCTION TO HARDWARE, SOFTWARE, AND ALGORITHM DEVELOPMENT

Week One: Introduction A SHORT INTRODUCTION TO HARDWARE, SOFTWARE, AND ALGORITHM DEVELOPMENT Week One: Introduction A SHORT INTRODUCTION TO HARDWARE, SOFTWARE, AND ALGORITHM DEVELOPMENT Outline In this chapter you will learn: About computer hardware, software and programming How to write and execute

More information

Math 7 Honors Final Exam Review #6

Math 7 Honors Final Exam Review #6 Name Date Math 7 Honors Final Exam Review #6 Final Exam Monday, June 18 th (8:00 am) Directions: Show your work. You may use a calculator. 1. In the morning, a farm worker packed 3 pints of strawberries

More information

S3 / S4 General Course Overview

S3 / S4 General Course Overview Unit 3.1 Rounding Nearest whole number Nearest 10, 100, 1000 Multiplying by 10, 100, 1000 by multiples eg. 20, 300, 4000 ividing by 10, 100, 1000 by multiples eg. 20, 300, 4000 Unit 3.2 Angles Types of

More information

Chapter 2. C++ Basics. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Chapter 2. C++ Basics. Copyright 2014 Pearson Addison-Wesley. All rights reserved. Chapter 2 C++ Basics Overview 2.1 Variables and Assignments 2.2 Input and Output 2.3 Data Types and Expressions 2.4 Simple Flow of Control 2.5 Program Style 3 2.1 Variables and Assignments Variables and

More information

Chapter 2. C++ Basics

Chapter 2. C++ Basics Chapter 2 C++ Basics Overview 2.1 Variables and Assignments 2.2 Input and Output 2.3 Data Types and Expressions 2.4 Simple Flow of Control 2.5 Program Style Slide 2-2 2.1 Variables and Assignments Variables

More information

Page 1 of 14 Version A Midterm Review 1. The sign means greater than. > =

More information

[B] hours b, P.I. A2.N.9 When simplified,

[B] hours b, P.I. A2.N.9 When simplified, Math B Regents Exam 0804 Page 1 1. 080401b, P.I. G.G.8 Which condition does not prove that two triangles are congruent? [A] SAS SAS [B] SSA SSA [C] ASA ASA [D] SSS SSS. 08040b, P.I. A.A.5 The speed of

More information

Indicate the answer choice that best completes the statement or answers the question. Enter the appropriate word(s) to complete the statement.

Indicate the answer choice that best completes the statement or answers the question. Enter the appropriate word(s) to complete the statement. 1. C#, C++, C, and Java use the symbol as the logical OR operator. a. $ b. % c. ^ d. 2. errors are relatively easy to locate and correct because the compiler or interpreter you use highlights every error.

More information

Applications. 38 Filling and Wrapping

Applications. 38 Filling and Wrapping Applications 1. Cut a sheet of paper in half so you have two identical half-sheets of paper. Tape the long sides of one sheet together to form a cylinder. Tape the short sides from the second sheet together

More information

Mathematics Scope & Sequence Grade 7 Revised: June 3, 2016 First Six Weeks (24 Days)

Mathematics Scope & Sequence Grade 7 Revised: June 3, 2016 First Six Weeks (24 Days) Mathematics Scope & Sequence 2016-2017 Grade 7 Revised: June 3, 2016 First Six Weeks (24 ) 7.3B apply and extend previous understandings of operations to solve problems using addition, subtraction, multiplication,

More information

Unit 5. Area & Volume. Area Composite Area Surface Area Volume. Math 6 Unit 5 Calendar 1/14 1/15 1/16 1/17 1/18. Name: Math Teacher:

Unit 5. Area & Volume. Area Composite Area Surface Area Volume. Math 6 Unit 5 Calendar 1/14 1/15 1/16 1/17 1/18. Name: Math Teacher: Math 6 Unit 5 Calendar 1/14 1/15 1/16 1/17 1/18 Name: Unit 5 Area & Volume Area Composite Area Surface Area Volume Review Or Computer Lab Unit 5 Test Or Computer Lab Unit 5 Test Or Computer Lab Unit 5

More information

Chapter Overview. C++ Basics. Variables and Assignments. Variables and Assignments. Keywords. Identifiers. 2.1 Variables and Assignments

Chapter Overview. C++ Basics. Variables and Assignments. Variables and Assignments. Keywords. Identifiers. 2.1 Variables and Assignments Chapter 2 C++ Basics Overview 2.1 Variables and Assignments 2.2 Input and Output 2.3 Data Types and Expressions 2.4 Simple Flow of Control 2.5 Program Style Copyright 2011 Pearson Addison-Wesley. All rights

More information

Grade 6 Curriculum and Instructional Gap Analysis Implementation Year

Grade 6 Curriculum and Instructional Gap Analysis Implementation Year Grade 6 Curriculum and Implementation Year 2014-2015 Revised Number and operations Proportionality What new content moves into the grade 6 curriculum in Use a visual representation to describe the relationship

More information

Perimeter, Area, Surface Area, & Volume

Perimeter, Area, Surface Area, & Volume Additional Options: Hide Multiple Choice Answers (Written Response) Open in Microsoft Word (add page breaks and/or edit questions) Generation Date: 11/25/2009 Generated By: Margaret Buell Copyright 2009

More information

Algebra I EOC Packet #

Algebra I EOC Packet # 1. Which inequality best describes the graph shown below? A y > x + 5 B y < x + 5 C y < x + 5 D y > x + 5 2. The table shows a set of values for x and y. x -3-2 1 3 6 y 7 5-1 -5-11 Which equation best

More information

25 Questions EOG Review #1 EOG REVIEW

25 Questions EOG Review #1 EOG REVIEW Questions EOG Review # EOG REVIEW Solve each: Give the BEST Answer. Name Period 9. Represent as a percent: 8% b. 80% c..4% d..8%. A rectangle is 4 meters long. It has a diagonal that is meters. How wide

More information

IDENTIFY WAYS OF REPRESENTING ALGORITHMS.

IDENTIFY WAYS OF REPRESENTING ALGORITHMS. IDENTIFY WAYS OF REPRESENTING ALGORITHMS. OBJECTIVES: Identify ways of representing algorithms: Content Representation of algorithms as Pseudocode or Flowcharts; use of flow chart symbols: input/output

More information

Mathematics Scope & Sequence Grade 7 Revised: June 9, 2017 First Quarter (38 Days)

Mathematics Scope & Sequence Grade 7 Revised: June 9, 2017 First Quarter (38 Days) Mathematics Scope & Sequence 2017-2018 Grade 7 Revised: June 9, 2017 First Quarter (38 ) 7.3B apply and extend previous understandings of operations to solve problems using addition, subtraction, multiplication,

More information

Someone else might choose to describe the closet by determining how many square tiles it would take to cover the floor. 6 ft.

Someone else might choose to describe the closet by determining how many square tiles it would take to cover the floor. 6 ft. Areas Rectangles One way to describe the size of a room is by naming its dimensions. So a room that measures 12 ft. by 10 ft. could be described by saying its a 12 by 10 foot room. In fact, that is how

More information

Mathematics Scope & Sequence Grade 8 Revised: June 2015

Mathematics Scope & Sequence Grade 8 Revised: June 2015 Mathematics Scope & Sequence 2015-16 Grade 8 Revised: June 2015 Readiness Standard(s) First Six Weeks (29 ) 8.2D Order a set of real numbers arising from mathematical and real-world contexts Convert between

More information

Quiz Determine the output of the following program:

Quiz Determine the output of the following program: Quiz Determine the output of the following program: 1 Structured Programming Using C++ Lecture 4 : Loops & Iterations Dr. Amal Khalifa Dr. Amal Khalifa - Spring 2012 1 Lecture Contents: Loops While do-while

More information

ICOM 4015: Advanced Programming

ICOM 4015: Advanced Programming ICOM 4015: Advanced Programming Lecture 1 Reading: Chapter One: Introduction Chapter 1 Introduction Chapter Goals To understand the activity of programming To learn about the architecture of computers

More information

Chapter 3 Problem Solving and the Computer

Chapter 3 Problem Solving and the Computer Chapter 3 Problem Solving and the Computer An algorithm is a step-by-step operations that the CPU must execute in order to solve a problem, or to perform that task. A program is the specification of an

More information

CHAPTER 2 PROBLEM SOLVING TECHNIQUES. Mr Mohd Hatta Bin Hj Mohamed Ali Computer Programming BFC2042

CHAPTER 2 PROBLEM SOLVING TECHNIQUES. Mr Mohd Hatta Bin Hj Mohamed Ali Computer Programming BFC2042 CHAPTER 2 PROBLEM SOLVING TECHNIQUES Mr Mohd Hatta Bin Hj Mohamed Ali Computer Programming BFC2042 Software Engineering vs Problem Solving Software Engineering - A branch of Computer Science & provides

More information

Introduction to Quadratic Functions Connecting Your Knowledge

Introduction to Quadratic Functions Connecting Your Knowledge Unit 4: Frogs, Fleas, & Painted Cubes//Investigation 1//Connections Name Class Date Introduction to Quadratic Functions Connecting Your Knowledge I can write equations for quadratic functions. Math / 30

More information

G Programming Languages - Fall 2012

G Programming Languages - Fall 2012 G22.2110-003 Programming Languages - Fall 2012 Lecture 3 Thomas Wies New York University Review Last week Names and Bindings Lifetimes and Allocation Garbage Collection Scope Outline Control Flow Sequencing

More information

PLD Semester Exam Study Guide Dec. 2018

PLD Semester Exam Study Guide Dec. 2018 Covers material from Chapters 1-8. Semester Exam will be built from these questions and answers, though they will be re-ordered and re-numbered and possibly worded slightly differently than on this study

More information

College Pre Calculus A Period. Weekly Review Sheet # 1 Assigned: Monday, 9/9/2013 Due: Friday, 9/13/2013

College Pre Calculus A Period. Weekly Review Sheet # 1 Assigned: Monday, 9/9/2013 Due: Friday, 9/13/2013 College Pre Calculus A Name Period Weekly Review Sheet # 1 Assigned: Monday, 9/9/013 Due: Friday, 9/13/013 YOU MUST SHOW ALL WORK FOR EVERY QUESTION IN THE BOX BELOW AND THEN RECORD YOUR ANSWERS ON THE

More information

Area rectangles & parallelograms

Area rectangles & parallelograms Area rectangles & parallelograms Rectangles One way to describe the size of a room is by naming its dimensions. So a room that measures 12 ft. by 10 ft. could be described by saying its a 12 by 10 foot

More information

CSC 121 Spring 2017 Howard Rosenthal

CSC 121 Spring 2017 Howard Rosenthal CSC 121 Spring 2017 Howard Rosenthal Agenda To be able to define computer program, algorithm, and highlevel programming language. To be able to list the basic stages involved in writing a computer program.

More information

Comparing and Modeling with Functions

Comparing and Modeling with Functions Name Date Class 13 Comparing and Modeling with Functions Quiz 1. Which of the following data sets is best described by a linear model? A {(5, 1), (4, 2), (3, 4), (2, 8)} B {(5, 1), (4, 1), (3, 3), (2,

More information

Structured English Examples

Structured English Examples Logic Modeling Logic and timing are not represented on data flow diagrams or entity-relationship diagrams Processes contain logic - what happens under what conditions Logic is modeled per process Types

More information

UNIT 6. Functions and Structured Programming

UNIT 6. Functions and Structured Programming UNIT 6 Functions and Structured Programming DAY 1 What is a Function? What is Structured Programming? I can.. Divide a large program into small problems. Write a Python program as a function Planning a

More information

A PROGRAM IS A SEQUENCE of instructions that a computer can execute to

A PROGRAM IS A SEQUENCE of instructions that a computer can execute to A PROGRAM IS A SEQUENCE of instructions that a computer can execute to perform some task. A simple enough idea, but for the computer to make any use of the instructions, they must be written in a form

More information

Algorithms and Conditionals

Algorithms and Conditionals Algorithms and Conditionals CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: www.csc.villanova.edu/~map/1051/

More information

Chapter 5 Conditional and Iterative Statements. Statement are the instructions given to the computer to perform any kind of action.

Chapter 5 Conditional and Iterative Statements. Statement are the instructions given to the computer to perform any kind of action. Chapter 5 Conditional and Iterative Statements Statement Statement are the instructions given to the computer to perform any kind of action. Types of Statement 1. Empty Statement The which does nothing.

More information

CSEN 102 Introduction to Computer Science

CSEN 102 Introduction to Computer Science CSEN 102 Introduction to Computer Science Lecture 2: Python and Sequential Algorithms Prof. Dr. Slim Abdennadher Dr. Aysha Alsafty, slim.abdennadher@guc.edu.eg, aysha.alsafty@guc.edu.eg German University

More information

Programming Logic - Beginning

Programming Logic - Beginning Instructor s Programming Logic - Beginning Designing Programs and Applications Programming Logic - Beginning 152-101 Designing Programs and Applications Quick Links & Text References Program Design Pages

More information

UNDERSTANDING PROBLEMS AND HOW TO SOLVE THEM BY USING COMPUTERS

UNDERSTANDING PROBLEMS AND HOW TO SOLVE THEM BY USING COMPUTERS UNDERSTANDING PROBLEMS AND HOW TO SOLVE THEM BY USING COMPUTERS INTRODUCTION TO PROBLEM SOLVING Introduction to Problem Solving Understanding problems Data processing Writing an algorithm CONTINUE.. Tool

More information

CSCE 120: Learning To Code

CSCE 120: Learning To Code CSCE 120: Learning To Code Manipulating Data I Introduction This module is designed to get you started working with data by understanding and using variables and data types in JavaScript. It will also

More information

Higher Computing Science Software Design and Development - Programming Summary Notes

Higher Computing Science Software Design and Development - Programming Summary Notes Higher Computing Science Software Design and Development - Programming Summary Notes Design notations A design notation is the method we use to write down our program design. Pseudocode is written using

More information

CS102 Unit 2. Sets and Mathematical Formalism Programming Languages and Simple Program Execution

CS102 Unit 2. Sets and Mathematical Formalism Programming Languages and Simple Program Execution 1 CS102 Unit 2 Sets and Mathematical Formalism Programming Languages and Simple Program Execution 2 Review Show how "Hi!\n" would be stored in the memory below Use decimal to represent each byte Remember

More information

Quadratics and Their Graphs

Quadratics and Their Graphs Quadratics and Their Graphs Graph each quadratic equation to determine its vertex and x-intercepts. Determine if the vertex is a maximum or minimum value. y = 0.3x + 3x 1 vertex maximum or minimum (circle

More information

1a 1b 1c. 1a 1b 1c. 6 7a 7b b

1a 1b 1c. 1a 1b 1c. 6 7a 7b b General Question Paper Analysis 2001-2009 2001 2002 2003 2004 2005 2006 2007 2008 2009 Calculations and basic numeracy BODMAS Add, subtract, divide, multiply Multiply or divide by multiples of 10 Squares,

More information

Mathematics 1201 Final Examination June 2013

Mathematics 1201 Final Examination June 2013 DO NOT OPEN THIS EXAMINATION PAPER UNTIL YOU ARE TOLD BY THE SUPERVISOR TO BEGIN Mathematics 20 Final Examination June 20 Student Name: Teacher Name: Total Value: 00 marks Time: Hours. Candidates are required

More information

SIF8035. Events and System Requirements

SIF8035. Events and System Requirements SIF8035 Lecture 4 DFD and PrM Events and System Requirements Events Occurrences at a specific time and place Trigger all system processing Requirement definition Determine relevant events External events

More information

Applications. 72 Variables and Patterns

Applications. 72 Variables and Patterns Applications. Sean bought a DVD player and a receiver. The store offered him an interest-free payment plan with weekly installments. Sean figured out that after n weeks of payments, he would still owe

More information

Objectives. Chapter 4: Control Structures I (Selection) Objectives (cont d.) Control Structures. Control Structures (cont d.) Relational Operators

Objectives. Chapter 4: Control Structures I (Selection) Objectives (cont d.) Control Structures. Control Structures (cont d.) Relational Operators Objectives Chapter 4: Control Structures I (Selection) In this chapter, you will: Learn about control structures Examine relational and logical operators Explore how to form and evaluate logical (Boolean)

More information

Similarity Review (Unit 4)

Similarity Review (Unit 4) Similarity Review (Unit 4) Name Using a compass and straightedge construct the image of the figure after a dilation with point C as the center of dilation and the given scale factor. Label the vertices

More information

Kenner Citizen Self Service

Kenner Citizen Self Service Kenner Citizen Self Service Online License Renewals First Time Registration In order to register for online renewals, you will need several pieces of information that are listed below: User Name and Password

More information

Problem 1: The relationship of height, in cm. and basketball players, names is a relation:

Problem 1: The relationship of height, in cm. and basketball players, names is a relation: Chapter - Functions and Graphs Chapter.1 - Functions, Relations and Ordered Pairs Relations A relation is a set of ordered pairs. Domain of a relation is the set consisting of all the first elements of

More information

February 8 th February 12 th. Unit 6: Polynomials & Introduction to Quadratics

February 8 th February 12 th. Unit 6: Polynomials & Introduction to Quadratics Algebra I February 8 th February 12 th Unit 6: Polynomials & Introduction to Quadratics Jump Start 1) Use the elimination method to solve the system of equations below. x + y = 2 3x + y = 8 2) Solve: 13

More information

Seventh Grade Spiraling Review Week 1 of First Six Weeks

Seventh Grade Spiraling Review Week 1 of First Six Weeks Week of First Six Weeks Note: Record all work in your math journal. Day Indicate if each of the given numbers below is equivalent to, less than, or greater than. Justify each response. 0.0, 0 4.7, %,,

More information

6th Grade P-AP Math Algebra

6th Grade P-AP Math Algebra 6th Grade P-AP Math Algebra If your student is considering a jump from 6th grade P-AP to 7th Grade Advanced math, please be advised of the following gaps in instruction. None of the 7th or 8th grade mathematics

More information

Chapter 4: Control Structures I (Selection)

Chapter 4: Control Structures I (Selection) Chapter 4: Control Structures I (Selection) 1 Objectives Learn about control structures Examine relational and logical operators Explore how to form and evaluate logical (Boolean) expressions Discover

More information

Visit the TA Helpdesk (schedule posted on class website)

Visit the TA Helpdesk (schedule posted on class website) CS 1301 Pair Homework 2 Conversions Due: Monday September 8th, before 11:55pm Out of 100 points Files to submit: hw2.py You will be writing several functions, but they will all be saved in one file: hw2.py.

More information

Chapter 4: Control Structures I (Selection) Objectives. Objectives (cont d.) Control Structures. Control Structures (cont d.

Chapter 4: Control Structures I (Selection) Objectives. Objectives (cont d.) Control Structures. Control Structures (cont d. Chapter 4: Control Structures I (Selection) In this chapter, you will: Objectives Learn about control structures Examine relational and logical operators Explore how to form and evaluate logical (Boolean)

More information

Chapter 1 Lab Algorithms, Errors, and Testing

Chapter 1 Lab Algorithms, Errors, and Testing Chapter 1 Lab Algorithms, Errors, and Testing Lab Objectives Be able to write an algorithm Be able to compile a Java program Be able to execute a Java program using the Sun JDK or a Java IDE Be able to

More information

CS1 Recitation. Week 2

CS1 Recitation. Week 2 CS1 Recitation Week 2 Sum of Squares Write a function that takes an integer n n must be at least 0 Function returns the sum of the square of each value between 0 and n, inclusive Code: (define (square

More information

Programming Logic and Design Sixth Edition

Programming Logic and Design Sixth Edition Objectives Programming Logic and Design Sixth Edition Chapter 4 Making Decisions In this chapter, you will learn about: Evaluating Boolean expressions to make comparisons The relational comparison operators

More information

Six Weeks:

Six Weeks: HPISD Grade 7 7/8 Math The student uses mathematical processes to: acquire and demonstrate mathematical understanding Mathematical Process Standards Apply mathematics to problems arising in everyday life,

More information

CHAPTER 2. Test Bank Exercises in. Exercise Set Solve for x the equation 3(2x 1) 2(x + 4) = 6.

CHAPTER 2. Test Bank Exercises in. Exercise Set Solve for x the equation 3(2x 1) 2(x + 4) = 6. Test Bank Exercises in CHAPTER Exercise Set.1 1. Solve for x the equation (x 1) (x + ) = 6. (a) x 17 (b) x = 6 (c) x 11 1. Solve for x the equation (1 x) (x + ) = (1 x). (a) x (b) x (c) x = 0 6. Solve

More information

2 + (-2) = 0. Hinojosa 7 th. Math Vocabulary Words. Unit 1. Word Definition Picture. The opposite of a number. Additive Inverse

2 + (-2) = 0. Hinojosa 7 th. Math Vocabulary Words. Unit 1. Word Definition Picture. The opposite of a number. Additive Inverse Unit 1 Word Definition Picture Additive Inverse The opposite of a number 2 + (-2) = 0 Equal Amount The same in quantity = Fraction A number in the form a/b, where b 0. Half One of two equal parts of a

More information

6.184 Lecture 4. Interpretation. Tweaked by Ben Vandiver Compiled by Mike Phillips Original material by Eric Grimson

6.184 Lecture 4. Interpretation. Tweaked by Ben Vandiver Compiled by Mike Phillips Original material by Eric Grimson 6.184 Lecture 4 Interpretation Tweaked by Ben Vandiver Compiled by Mike Phillips Original material by Eric Grimson 1 Interpretation Parts of an interpreter Arithmetic calculator

More information

CHAPTER. Daniel Nickerson Salisbury, NC. Three-Dimensional Figures 217

CHAPTER. Daniel Nickerson Salisbury, NC. Three-Dimensional Figures 217 CHAPTER 9 Three-Dimensional Figures Daniel Nickerson Salisbury, NC Three-Dimensional Figures 7 9. Three-Dimensional Figures Objective: to classify three-dimensional figures A solid is a three-dimensional

More information