Iteration Part 2. Review: Iteration [Part 1] Flow charts for two loop constructs. Review: Syntax of loops. while continuation_condition : statement1

Size: px
Start display at page:

Download "Iteration Part 2. Review: Iteration [Part 1] Flow charts for two loop constructs. Review: Syntax of loops. while continuation_condition : statement1"

Transcription

1 Review: Iteratin [Part 1] Iteratin Part 2 CS111 Cmputer Prgramming Department f Cmputer Science Wellesley Cllege Iteratin is the repeated executin f a set f statements until a stpping cnditin is reached. while lps are an iteratin cnstruct used when it is nt knwn in advance hw lng executin shuld cntinue. fr lps (an abstractin f while lps) are used when we have a fixed set f items in a sequence t iterate ver. If the stpping cnditin is never reached, the lp will run frever. It is knwn in this case as an infinite lp. The stpping cnditin might invlve ne r mre state variables, and we need t make sure that the bdy f the lp cntains statements that cntinuusly update these state variables. We can use the mdel f iteratin tables t understand the inner wrkings f a lp. Its clumns represent the state variables and the rws represent their values in every iteratin Review: Syntax f lps while cntinuatin_cnditin : Cmparing the syntax f bth lp cnstructs. a blean expressin denting whether t iterate thrugh the bdy f the lp ne mre time. Flw charts fr tw lp cnstructs while cntinuatin _cnditin while lp bdy A variable that takes its values frm the items f the sequence. fr var in sequence: A sequence f items: characters in a string, items in a list, the result f range, etc. Still elements in sequence fr lp bdy fr

2 Review: sumbetween with while lp In[6]: sumbetween(4,8) Out[6]: 30 # sumbetween(4,8) returns 30 sumbetween(4,4) returns 4 sumbetween(4,3) returns 0 Using the iteratin table t reasn abut a prblem. step l hi sumsfar def sumbetween(l, hi): '''Returns the sum f the integers frm l t hi (inclusive). Assume l and hi are integers.''' sumsfar = 0 initialize accumulatr T ntice: while l <= hi: Rw 0 in the table shws the sumsfar += l initial values f all state l += 1 update accumulatr variables. return sumsfar Rw 1 shws values after the updates in the lp bdy. ccumulatr 11-5 Tday s tpics Nested fr lps Hw t interrupt lps with cde? Swapping tw variable values Simultaneus assignment in Pythn 11-6 Nested lps fr printing A fr lp bdy can cntain a fr lp. Outer lp fr i in range(2, 6): fr j in range(2, 6): print i, 'x', j, '=', i*j Tw nested lps: the uter and inner lp. Inner lp # print the multiplicatin table frm 2 t 5 2 x 2 = 4 2 x 3 = 6 T ntice: 2 x 4 = 8 Variable i in the uter lp is set initially t value 2. 2 x 5 = 10 Variable j in the inner lp is set initially t value 2. 3 x 2 = 6 Variable j keeps changing its value: 3, 4, 5, meanwhile i desn t change. 3 x 3 = 9 When i becmes 3, j restarts its cycle: 2, 3, 4,5, and s 3 x 4 = 12 it repeats, until i has taken values ver all items f the... list 2, 3, 4, Nested lps fr accumulatin def isvwel(char): return char.lwer() in 'aeiu' verse = "Tw rads diverged in a yellw wd" fr wrd in verse.split(): cunter = 0 fr letter in wrd: if isvwel(letter): cunter += 1 print 'Vwels in', wrd, '->', cunter Vwels in Tw -> 1 Vwels in rads -> 2 Vwels in diverged -> 3 Vwels in in -> 1 Vwels in a -> 1 Vwels in yellw -> 2 Vwels in wd -> 2 Using nested lps fr successive accumulatins. T ntice: The accumulatr variable cunter is set t 0 every time the inner lp starts. Outer lp iterates ver a list f wrds. Inner lp iterates ver characters in a string. 11-8

3 Flw Chart fr nested fr lps Exercise: print wrds What is printed? fr letter in ['g','p','d','s']: fr letter2 in ['ib', 'ump']: print letter + letter2 A flw chart diagram t explain the cde executin fr the example in Exercise: Nested Lps with graphics Here's a picture invlving a grid f randmly clred circles with radius = 50 n a 800x600 canvas. This picture is created using tw nested fr lps and the Clr.randmClr() functin. Hw wuld yu d that? (50, 50) (150, 50) (250, 50) Interrupting Lps Smetimes we want t interrupt a lp withut iterating ver all elements f a sequence. Examples: When we have fund an element we re lking fr When we re accumulating a value thrugh a fr lp and reached sme desired value There are tw situatins when we can d this: Within a functin, via a return statement Within a blck f cde, via a break statement (50, 350) (50, 450) (50, 550) Imprtant: - We will nt cver break in this lecture. - lways exits the bdy f a functin. - We ll use break when we want t exit a lp, but nt the functin

4 Returning early frm a lp In a functin, return can be used t exit the lp early (e.g., befre it visits all the elements in a list). def iselementof(val, elts): '''Returns if val is fund in elts; therwise''' fr e in elts: if e == val: return # return (and exit the functin) # as sn as val is encuntered return # nly get here if val is nt in elts In [1]: sentence = 'the cat that ate the muse liked the dg that played with the ball' Premature return dne wrng (1) def iselementofbrken(val, elts): '''Faulty versin that returns if val is fund in elts; therwise''' fr e in elts: if e == val: return else: return The functin always returns after the 1 st element withut examining the rest f the list. In [2]: iselementof('cat', sentence.split()) Out[2]: # returns as sn as 'cat' is encuntered In[]: iselementofbrken(2, [2, 6, 1]) Out[]: In [3]: iselementof('bunny', sentence.split()) Out[3]: In[]: iselementofbrken(6, [2, 6, 1]) Out[]: Premature return dne wrng (2) def sumhalvesbrken2(n): '''Brken versin f returns sum f halves f n''' sumsfar = 0 while n > 0: sumsfar = sumsfar + n # r sumsfar += n n = n/2 return sumsfar # wrng indentatin! # exits functin after first # lp iteratin. Smetimes we # want this, but nt here! Wrng indentatin within the lp. Functin returns after first iteratin In [4]: sumhalvesbrken2(22) Out[4]: 22 Exercises [in the ntebk] In the ntebk we ll write the fllwing functins that return early. cntainsdigits cntainsdigit('the answer is 42') cntainsdigit('76 trmbnes') cntainsdigit('the cat ate the muse') cntainsdigit('ne tw three') areallpsitive areallpsitive([17, 5, 42, 16, 31]) areallpsitive([17, 5, -42, 16, 31]) areallpsitive([-17, 5, -42, -16, 31]) areallpsitive([]) indexof indexof(8, [8,3,6,7,2,4]) indexof(7, [8,3,6,7,2,4]) indexof(5, [8,3,6,7,2,4]) Returns Hint String bjects have a methd called isdigit, try it ut

5 lngestcnsnantsubstring Swapping Values in Pythn T swap the values f tw variables, a third variable is needed. lngestcnsnantsubstring('strng') returns 'str' lngestcnsnantsubstring('strengths') returns 'ngths' lngestcnsnantsubstring('lightning') returns 'ghtn' lngestcnsnantsubstring('prgram') returns 'Pr' lngestcnsnantsubstring('adbe') returns 'd' def lngestcnsnantsubstring(s): '''Returns the lngest substring f cnsecutive cnsnants. If mre than ne such substring has the same length, returns the first t appear in the string. ''' Nte: This is hard! Draw iteratin tables first! What state variables d yu need? Imagine yu have a list f numbers that yu want t srt by swapping tw adjacent (neighbr) items every time ne is smaller than the ther. This is a famus algrithm knwn as the bubble srt, and is usually implemented via nested fr lps. If yu re curius read this page. Yu ll learn hw t implement bubble srt in CS 230. Start f list nums = [3, 2, 1, 4] After 1 st swap nums = [2, 3, 1, 4] After 2 nd swap nums = [2, 1, 3, 4] After 3 rd swap nums = [1, 2, 3, 4] If we want t d the first swap f 3 and 2, can we write the fllwing? nums[0] = nums[1] nums[1] = nums[0] Try it ut t see what happens. The slutin in this case wuld lk like this: tempval = nums[0] nums[0] = nums[1] nums[1] = tempval Simultaneus assignment in Pythn In Pythn, we can assign values t many variables at nce, here are sme examples, that yu shuld try in the cnsle: a, b = 0, 1 a, b, c = 1, 2, 3 a, b = "AB" a, b = [10, 20] a, b = (15, 25) a, b, c, d = [1, 2, 3, 4] Swapping thrugh simultaneus assignment a, b = b, a num[0], num[1] = num[1], num[0] It is pssible t assign values t multiple variables in ne statement. The reasn that these assignments wrk is that there is an equal number f variables and values n each side. Even the string AB is a sequence f tw characters. Try a different number f variables r values n bth sides t see what errrs yu get. D these statements wrk? Variable update rder matters def sumhalvesbrken(n): sumsfar = 0 while n > 0: n = n/2 # updates n t early! sumsfar += n return sumsfar In [3]: sumhalvesbrken(22) Out[3]: 19 Imprtant: If update rules invlve rules where state variables are dependent n ne anther, be very careful with the rder f updates. step n sumsfar This table is the slutin t slide

6 Simultaneus update example: Greatest Cmmn Divisr algrithm The greatest cmmn divisr (gcd) f integers a and b is largest integers that divides bth a and b Eg: gcd(84, 60) is 12 Euclid (300 BC) wrte this algrithm t cmpute the GCD: Given a and b, repeat the fllwing steps until b is 0. Let the new value f b be the remainder f dividing a by b Let the new value f a be the ld value f b this is a perfect pprtunity fr a while lp. step a b Simultaneus update (e.g., gcd) step a b step a b step a b Neither f the fllwing tw gcd functins wrks. Why? def gcdbrken1(a, b): a = b b = a % b def gcdbrken2(a, b): b = a % b a = b Fixing simultaneus update step a b step a b def gcdfixed1(a, b): preva = a prevb = b a = prevb b = preva % prevb step a b def gcdfixed2(a, b): preva = a prevb = b b = preva % prevb a = prevb Pythn s simultaneus assignment is an even mre elegant slutin! def gcdfixed3(a, b): a, b = b, a % b # simultaneus assignment f a # pair f values t a pair # f variables (parens ptinal) T ntice: - Functins 1&2 use temprary variables t stre values befre updates. - The third functin assigns multiple values in ne step Test yur knwledge 1. The sumbetween slutin in 11-5 has an iteratin table with three state variables. Hw will the iteratin table lk like if the slutin is written with a fr lp (see Ntebk Lecture 9). 2. If we want t print ut the entire multiplicatin table fr 1 t 10, hw many times will the print statement in 11-7 be executed. 3. What wuld be the value f cunter in 11-8, if we mve the assignment statement befre the uter fr lp? 4. What results will be printed in 11-8 if the cunter assignment statements mves within the inner lp? 5. Fr the exercise in 11-11, try t draw a flw chart diagram as the ne in 11-9, befre writing cde t slve the prblem. 6. What is an alternative way f writing the functin in 11-4, which leads t the same gtcha? 7. Only by reasning abut the prblems in (n need t write cde yet), which f them needs t be slved with the accumulatr pattern? 8. If yu write 0, 1, 2 in the Pythn cnsle, what kind f type will Pythn assign t this sequence f numbers? Hw des that help fr simultaneus assignments? 11-24

CS1150 Principles of Computer Science Loops

CS1150 Principles of Computer Science Loops CS1150 Principles f Cmputer Science Lps Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Clrad Springs Annuncement HW1 graded HW2 due tnight HW3 will be psted sn Due

More information

The Java if statement is used to test the condition. It checks Boolean condition: true or false. There are various types of if statement in java.

The Java if statement is used to test the condition. It checks Boolean condition: true or false. There are various types of if statement in java. Java If-else Statement The Java if statement is used t test the cnditin. It checks Blean cnditin: true r false. There are varius types f if statement in java. if statement if-else statement if-else-if

More information

Introduction to CS111 Part 2: Big Ideas

Introduction to CS111 Part 2: Big Ideas What is Cmputer Science? Intrductin t CS111 Part 2: Big Ideas CS111 Cmputer Prgramming Department f Cmputer Science Wellesley Cllege It s nt really abut cmputers. It s nt really a science. It s abut imperative

More information

CS1150 Principles of Computer Science Midterm Review

CS1150 Principles of Computer Science Midterm Review CS1150 Principles f Cmputer Science Midterm Review Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Clrad Springs Office hurs 10/15, Mnday, 12:05 12:50pm 10/17, Wednesday

More information

Eastern Mediterranean University School of Computing and Technology Information Technology Lecture2 Functions

Eastern Mediterranean University School of Computing and Technology Information Technology Lecture2 Functions Eastern Mediterranean University Schl f Cmputing and Technlgy Infrmatin Technlgy Lecture2 Functins User Defined Functins Why d we need functins? T make yur prgram readable and rganized T reduce repeated

More information

Lab 4. Name: Checked: Objectives:

Lab 4. Name: Checked: Objectives: Lab 4 Name: Checked: Objectives: Learn hw t test cde snippets interactively. Learn abut the Java API Practice using Randm, Math, and String methds and assrted ther methds frm the Java API Part A. Use jgrasp

More information

1 Version Spaces. CS 478 Homework 1 SOLUTION

1 Version Spaces. CS 478 Homework 1 SOLUTION CS 478 Hmewrk SOLUTION This is a pssible slutin t the hmewrk, althugh there may be ther crrect respnses t sme f the questins. The questins are repeated in this fnt, while answers are in a mnspaced fnt.

More information

Primitive Types and Methods. Reference Types and Methods. Review: Methods and Reference Types

Primitive Types and Methods. Reference Types and Methods. Review: Methods and Reference Types Primitive Types and Methds Java uses what is called pass-by-value semantics fr methd calls When we call a methd with input parameters, the value f that parameter is cpied and passed alng, nt the riginal

More information

Pages of the Template

Pages of the Template Instructins fr Using the Oregn Grades K-3 Engineering Design Ntebk Template Draft, 12/8/2011 These instructins are fr the Oregn Grades K-3 Engineering Design Ntebk template that can be fund n the web at

More information

Lab 5 Sorting with Linked Lists

Lab 5 Sorting with Linked Lists UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C WINTER 2013 Lab 5 Srting with Linked Lists Intrductin Reading This lab intrduces

More information

CS510 Concurrent Systems Class 2. A Lock-Free Multiprocessor OS Kernel

CS510 Concurrent Systems Class 2. A Lock-Free Multiprocessor OS Kernel CS510 Cncurrent Systems Class 2 A Lck-Free Multiprcessr OS Kernel The Synthesis kernel A research prject at Clumbia University Synthesis V.0 ( 68020 Uniprcessr (Mtrla N virtual memry 1991 - Synthesis V.1

More information

- Replacement of a single statement with a sequence of statements(promotes regularity)

- Replacement of a single statement with a sequence of statements(promotes regularity) ALGOL - Java and C built using ALGOL 60 - Simple and cncise and elegance - Universal - Clse as pssible t mathematical ntatin - Language can describe the algrithms - Mechanically translatable t machine

More information

CSE 361S Intro to Systems Software Lab #2

CSE 361S Intro to Systems Software Lab #2 Due: Thursday, September 22, 2011 CSE 361S Intr t Systems Sftware Lab #2 Intrductin This lab will intrduce yu t the GNU tls in the Linux prgramming envirnment we will be using fr CSE 361S this semester,

More information

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Yu will learn the fllwing in this lab: The UNIVERSITY f NORTH CAROLINA at CHAPEL HILL Cmp 541 Digital Lgic and Cmputer Design Spring 2016 Lab Prject (PART A): A Full Cmputer! Issued Fri 4/8/16; Suggested

More information

Relational Operators, and the If Statement. 9.1 Combined Assignments. Relational Operators (4.1) Last time we discovered combined assignments such as:

Relational Operators, and the If Statement. 9.1 Combined Assignments. Relational Operators (4.1) Last time we discovered combined assignments such as: Relatinal Operatrs, and the If Statement 9/18/06 CS150 Intrductin t Cmputer Science 1 1 9.1 Cmbined Assignments Last time we discvered cmbined assignments such as: a /= b + c; Which f the fllwing lng frms

More information

COP2800 Homework #3 Assignment Spring 2013

COP2800 Homework #3 Assignment Spring 2013 YOUR NAME: DATE: LAST FOUR DIGITS OF YOUR UF-ID: Please Print Clearly (Blck Letters) YOUR PARTNER S NAME: DATE: LAST FOUR DIGITS OF PARTNER S UF-ID: Please Print Clearly Date Assigned: 15 February 2013

More information

CS1150 Principles of Computer Science Methods

CS1150 Principles of Computer Science Methods CS1150 Principles f Cmputer Science Methds Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Clrad Springs Opening Prblem Find the sum f integers frm 1 t 10, frm 20

More information

Lab 1 - Calculator. K&R All of Chapter 1, 7.4, and Appendix B1.2

Lab 1 - Calculator. K&R All of Chapter 1, 7.4, and Appendix B1.2 UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2012 Lab 1 - Calculatr Intrductin In this lab yu will be writing yur first

More information

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Yu will learn the fllwing in this lab: The UNIVERSITY f NORTH CAROLINA at CHAPEL HILL Designing a mdule with multiple memries Designing and using a bitmap fnt Designing a memry-mapped display Cmp 541 Digital

More information

Maintaining order. A small student database. Managing databases. Representing table of student data. Sorting and searching

Maintaining order. A small student database. Managing databases. Representing table of student data. Sorting and searching Maintaining rder Srting and searching A small student database ID# First Last Year Majr 1 Jane Williams 2007 BISC 2 Ann Smith 2009 CS GPA 3.3 2.8 3 Susan Jnes 2008 ARTS 3.1 4 Claire French 2007 ENG 2.7

More information

DECISION CONTROL CONSTRUCTS IN JAVA

DECISION CONTROL CONSTRUCTS IN JAVA DECISION CONTROL CONSTRUCTS IN JAVA Decisin cntrl statements can change the executin flw f a prgram. Decisin cntrl statements in Java are: if statement Cnditinal peratr switch statement If statement The

More information

Laboratory #13: Trigger

Laboratory #13: Trigger Schl f Infrmatin and Cmputer Technlgy Sirindhrn Internatinal Institute f Technlgy Thammasat University ITS351 Database Prgramming Labratry Labratry #13: Trigger Objective: - T learn build in trigger in

More information

CS1150 Principles of Computer Science Boolean, Selection Statements (Part II)

CS1150 Principles of Computer Science Boolean, Selection Statements (Part II) CS1150 Principles f Cmputer Science Blean, Selectin Statements (Part II) Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 Review What s the scientific ntatin f 9,200,000?

More information

In-Class Exercise. Hashing Used in: Hashing Algorithm

In-Class Exercise. Hashing Used in: Hashing Algorithm In-Class Exercise Hashing Used in: Encryptin fr authenticatin Hash a digital signature, get the value assciated with the digital signature,and bth are sent separately t receiver. The receiver then uses

More information

MATH PRACTICE EXAM 2 (Sections 2.6, , )

MATH PRACTICE EXAM 2 (Sections 2.6, , ) MATH 1050-90 PRACTICE EXAM 2 (Sectins 2.6, 3.1-3.5, 7.1-7.6) The purpse f the practice exam is t give yu an idea f the fllwing: length f exam difficulty level f prblems Yur actual exam will have different

More information

Querying Data with Transact SQL

Querying Data with Transact SQL Querying Data with Transact SQL Curse Cde: 20761 Certificatin Exam: 70-761 Duratin: 5 Days Certificatin Track: MCSA: SQL 2016 Database Develpment Frmat: Classrm Level: 200 Abut this curse: This curse is

More information

LAB 7 (June 29/July 4) Structures, Stream I/O, Self-referential structures (Linked list) in C

LAB 7 (June 29/July 4) Structures, Stream I/O, Self-referential structures (Linked list) in C LAB 7 (June 29/July 4) Structures, Stream I/O, Self-referential structures (Linked list) in C Due: July 9 (Sun) 11:59 pm 1. Prblem A Subject: Structure declaratin, initializatin and assignment. Structure

More information

Lab 1 - Calculator. K&R All of Chapter 1, 7.4, and Appendix B1.2 Iterative Code Design handout Style Guidelines handout

Lab 1 - Calculator. K&R All of Chapter 1, 7.4, and Appendix B1.2 Iterative Code Design handout Style Guidelines handout UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2013 Lab 1 - Calculatr Intrductin Reading Cncepts In this lab yu will be

More information

Chapter 6: Lgic Based Testing LOGIC BASED TESTING: This unit gives an indepth verview f lgic based testing and its implementatin. At the end f this unit, the student will be able t: Understand the cncept

More information

MySqlWorkbench Tutorial: Creating Related Database Tables

MySqlWorkbench Tutorial: Creating Related Database Tables MySqlWrkbench Tutrial: Creating Related Database Tables (Primary Keys, Freign Keys, Jining Data) Cntents 1. Overview 2 2. Befre Yu Start 2 3. Cnnect t MySql using MySqlWrkbench 2 4. Create Tables web_user

More information

Preparation: Follow the instructions on the course website to install Java JDK and jgrasp on your laptop.

Preparation: Follow the instructions on the course website to install Java JDK and jgrasp on your laptop. Lab 1 Name: Checked: (instructr r TA initials) Objectives: Learn abut jgrasp - the prgramming envirnment that we will be using (IDE) Cmpile and run a Java prgram Understand the relatinship between a Java

More information

Chief Reader Report on Student Responses:

Chief Reader Report on Student Responses: Chief Reader Reprt n Student Respnses: 2018 AP Cmputer Science A Free-Respnse Questins Number f Students Scred 65,133 Number f Readers 317 Scre Distributin Exam Scre N %At 5 16,105 24.7 4 13,802 21.2 3

More information

CS1150 Principles of Computer Science Methods

CS1150 Principles of Computer Science Methods CS1150 Principles f Cmputer Science Methds Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Clrad Springs Passing Parameters public static vid nprintln(string message,

More information

CS1150 Principles of Computer Science Boolean, Selection Statements (Part II)

CS1150 Principles of Computer Science Boolean, Selection Statements (Part II) CS1150 Principles f Cmputer Science Blean, Selectin Statements (Part II) Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 Review What s the scientific ntatin f 9,200,000?

More information

Exam 4 Review: SQL, pymysql, and XML CS 2316 Fall 2011

Exam 4 Review: SQL, pymysql, and XML CS 2316 Fall 2011 Exam 4 Review: SQL, pymysql, and XML CS 2316 Fall 2011 This is a nn-exhaustive list f tpics t study. Yu will be held respnsible fr all readings n the curse website and lecture cntents even if they are

More information

INSTALLING CCRQINVOICE

INSTALLING CCRQINVOICE INSTALLING CCRQINVOICE Thank yu fr selecting CCRQInvice. This dcument prvides a quick review f hw t install CCRQInvice. Detailed instructins can be fund in the prgram manual. While this may seem like a

More information

Iteration Part 1. Motivation for iteration. How does a for loop work? Execution model of a for loop. What is Iteration?

Iteration Part 1. Motivation for iteration. How does a for loop work? Execution model of a for loop. What is Iteration? Iteration Part 1 Motivation for iteration Display time until no more time left Iteration is a problemsolving strategy found in many situations. Keep coding until all test cases passed CS111 Computer Programming

More information

Graphics Transformations and Layers

Graphics Transformations and Layers Graphics Transfrmatins and Layers CS111 Cmputer Prgramming Department f Cmputer Science Wellesley Cllege Review cs1graphics Things t knw: All ur graphics prgrams shuld start with: frm cs1graphics imprt

More information

High School - Mathematics Related Basic Skill or Concept

High School - Mathematics Related Basic Skill or Concept Reprting Categry Knwledge High Schl - Mathematics r Cncept Sample Instructinal Activities Expressins Operatins HSM-EO 1 HSM-EO 2 a) match an algebraic expressin invlving ne peratin t represent a given

More information

Ascii Art Capstone project in C

Ascii Art Capstone project in C Ascii Art Capstne prject in C CSSE 120 Intrductin t Sftware Develpment (Rbtics) Spring 2010-2011 Hw t begin the Ascii Art prject Page 1 Prceed as fllws, in the rder listed. 1. If yu have nt dne s already,

More information

Data Structure Interview Questions

Data Structure Interview Questions Data Structure Interview Questins A list f tp frequently asked Data Structure interview questins and answers are given belw. 1) What is Data Structure? Explain. Data structure is a way that specifies hw

More information

McGill University School of Computer Science COMP-206. Software Systems. Due: September 29, 2008 on WEB CT at 23:55.

McGill University School of Computer Science COMP-206. Software Systems. Due: September 29, 2008 on WEB CT at 23:55. Schl f Cmputer Science McGill University Schl f Cmputer Science COMP-206 Sftware Systems Due: September 29, 2008 n WEB CT at 23:55 Operating Systems This assignment explres the Unix perating system and

More information

Using the Swiftpage Connect List Manager

Using the Swiftpage Connect List Manager Quick Start Guide T: Using the Swiftpage Cnnect List Manager The Swiftpage Cnnect List Manager can be used t imprt yur cntacts, mdify cntact infrmatin, create grups ut f thse cntacts, filter yur cntacts

More information

Code should compile and demonstrate proper programming style; e.g., whitespace, identifier naming, etc.

Code should compile and demonstrate proper programming style; e.g., whitespace, identifier naming, etc. Name: E-mail ID: On my hnr, I pledge that I have neither given nr received help n this test. Signature: Test rules and infrmatin Print yur name, id, and pledge as requested. The nly paper yu can have in

More information

Announcement. VHDL in Action. Review. Statements. Process Execution with no sensitivity list. Sequential Statements

Announcement. VHDL in Action. Review. Statements. Process Execution with no sensitivity list. Sequential Statements Annuncement Prject 2: Assigned tday, due 9/30 ning f class. VHDL in Actin Mdeling a binary/gray cunter. As always, start early Chapter 3 Sequential Statements 1 Review Statements Architecture bdy Cncurrent

More information

$ARCSIGHT_HOME/current/user/agent/map. The files are named in sequential order such as:

$ARCSIGHT_HOME/current/user/agent/map. The files are named in sequential order such as: Lcatin f the map.x.prperties files $ARCSIGHT_HOME/current/user/agent/map File naming cnventin The files are named in sequential rder such as: Sme examples: 1. map.1.prperties 2. map.2.prperties 3. map.3.prperties

More information

ClassFlow Administrator User Guide

ClassFlow Administrator User Guide ClassFlw Administratr User Guide ClassFlw User Engagement Team April 2017 www.classflw.cm 1 Cntents Overview... 3 User Management... 3 Manual Entry via the User Management Page... 4 Creating Individual

More information

Higher Maths EF1.2 and RC1.2 Trigonometry - Revision

Higher Maths EF1.2 and RC1.2 Trigonometry - Revision Higher Maths EF and R Trignmetry - Revisin This revisin pack cvers the skills at Unit Assessment and exam level fr Trignmetry s yu can evaluate yur learning f this utcme. It is imprtant that yu prepare

More information

Web of Science Institutional authored and cited papers

Web of Science Institutional authored and cited papers Web f Science Institutinal authred and cited papers Prcedures written by Diane Carrll Washingtn State University Libraries December, 2007, updated Nvember 2009 Annual review f paper s authred and cited

More information

Scroll down to New and another menu will appear. Select Folder and a new

Scroll down to New and another menu will appear. Select Folder and a new Creating a New Flder Befre we begin with Micrsft Wrd, create a flder n yur Desktp named Summer PD. T d this, right click anywhere n yur Desktp and a menu will appear. Scrll dwn t New and anther menu will

More information

Adverse Action Letters

Adverse Action Letters Adverse Actin Letters Setup and Usage Instructins The FRS Adverse Actin Letter mdule was designed t prvide yu with a very elabrate and sphisticated slutin t help autmate and handle all f yur Adverse Actin

More information

TRAINING GUIDE. Overview of Lucity Spatial

TRAINING GUIDE. Overview of Lucity Spatial TRAINING GUIDE Overview f Lucity Spatial Overview f Lucity Spatial In this sessin, we ll cver the key cmpnents f Lucity Spatial. Table f Cntents Lucity Spatial... 2 Requirements... 2 Setup... 3 Assign

More information

TUTORIAL --- Learning About Your efolio Space

TUTORIAL --- Learning About Your efolio Space TUTORIAL --- Learning Abut Yur efli Space Designed t Assist a First-Time User Available t All Overview Frm the mment yu lg in t yur just created myefli accunt, yu will find help ntes t guide yu in learning

More information

Using SPLAY Tree s for state-full packet classification

Using SPLAY Tree s for state-full packet classification Curse Prject Using SPLAY Tree s fr state-full packet classificatin 1- What is a Splay Tree? These ntes discuss the splay tree, a frm f self-adjusting search tree in which the amrtized time fr an access,

More information

Scatter Search And Bionomic Algorithms For The Aircraft Landing Problem

Scatter Search And Bionomic Algorithms For The Aircraft Landing Problem Scatter Search And Binmic Algrithms Fr The Aircraft Landing Prblem J. E. Beasley Mathematical Sciences Brunel University Uxbridge UB8 3PH United Kingdm http://peple.brunel.ac.uk/~mastjjb/jeb/jeb.html Abstract:

More information

Lab 0: Compiling, Running, and Debugging

Lab 0: Compiling, Running, and Debugging UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2012 Lab 0: Cmpiling, Running, and Debugging Intrductin Reading This is the

More information

UNIT 7 RIGHT ANGLE TRIANGLES

UNIT 7 RIGHT ANGLE TRIANGLES UNIT 7 RIGHT ANGLE TRIANGLES Assignment Title Wrk t cmplete Cmplete Cmplete the vcabulary wrds n Vcabulary the attached handut with infrmatin frm the bklet r text. 1 Triangles Labelling Triangles 2 Pythagrean

More information

CS1150 Principles of Computer Science Introduction (Part II)

CS1150 Principles of Computer Science Introduction (Part II) Principles f Cmputer Science Intrductin (Part II) Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang UC. Clrad Springs Review Terminlgy Class } Every Java prgram must have at least

More information

24-4 Image Formation by Thin Lenses

24-4 Image Formation by Thin Lenses 24-4 Image Frmatin by Thin Lenses Lenses, which are imprtant fr crrecting visin, fr micrscpes, and fr many telescpes, rely n the refractin f light t frm images. As with mirrrs, we draw ray agrams t help

More information

BI Publisher TEMPLATE Tutorial

BI Publisher TEMPLATE Tutorial PepleSft Campus Slutins 9.0 BI Publisher TEMPLATE Tutrial Lessn T2 Create, Frmat and View a Simple Reprt Using an Existing Query with Real Data This tutrial assumes that yu have cmpleted BI Publisher Tutrial:

More information

Project 4: System Calls 1

Project 4: System Calls 1 CMPT 300 1. Preparatin Prject 4: System Calls 1 T cmplete this assignment, it is vital that yu have carefully cmpleted and understd the cntent in the fllwing guides which are psted n the curse website:

More information

Working With Audacity

Working With Audacity Wrking With Audacity Audacity is a free, pen-surce audi editing prgram. The majr user interface elements are highlighted in the screensht f the prgram s main windw belw. The editing tls are used t edit

More information

Exercises: Plotting Complex Figures Using R

Exercises: Plotting Complex Figures Using R Exercises: Pltting Cmplex Figures Using R Versin 2017-11 Exercises: Pltting Cmplex Figures in R 2 Licence This manual is 2016-17, Simn Andrews. This manual is distributed under the creative cmmns Attributin-Nn-Cmmercial-Share

More information

Computer Organization and Architecture

Computer Organization and Architecture Campus de Gualtar 4710-057 Braga UNIVERSIDADE DO MINHO ESCOLA DE ENGENHARIA Departament de Infrmática Cmputer Organizatin and Architecture 5th Editin, 2000 by William Stallings Table f Cntents I. OVERVIEW.

More information

Tymberwood Academy. Introduction

Tymberwood Academy. Introduction Tymberwd Academy Intrductin Children are intrduced t the prcesses f calculatin thrugh practical, ral and mental activities. As they begin t understand the underlying ideas, they develp ways f recrding

More information

CS5530 Mobile/Wireless Systems Swift

CS5530 Mobile/Wireless Systems Swift Mbile/Wireless Systems Swift Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang UC. Clrad Springs cat annunce.txt_ imacs remte VNC access VNP: http://www.uccs.edu/itservices/services/netwrk-andinternet/vpn.html

More information

Beyond Verification. Software Synthesis

Beyond Verification. Software Synthesis Beynd Verificatin Sftware Synthesis 1 What d we mean by synthesis We want t get cde frm high-level specs - Pythn and VB are pretty high level, why is that nt synthesis? Supprt cmpsitinal and incremental

More information

You need to be able to define the following terms and answer basic questions about them:

You need to be able to define the following terms and answer basic questions about them: CS440/ECE448 Fall 2016 Midterm Review Yu need t be able t define the fllwing terms and answer basic questins abut them: Intr t AI, agents and envirnments Pssible definitins f AI, prs and cns f each Turing

More information

Configuring Database & SQL Query Monitoring With Sentry-go Quick & Plus! monitors

Configuring Database & SQL Query Monitoring With Sentry-go Quick & Plus! monitors Cnfiguring Database & SQL Query Mnitring With Sentry-g Quick & Plus! mnitrs 3Ds (UK) Limited, Nvember, 2013 http://www.sentry-g.cm Be Practive, Nt Reactive! One f the best ways f ensuring a database is

More information

CMU 15-7/381 CSPs. Teachers: Ariel Procaccia Emma Brunskill (THIS TIME) With thanks to Ariel Procaccia and other prior instructions for slides

CMU 15-7/381 CSPs. Teachers: Ariel Procaccia Emma Brunskill (THIS TIME) With thanks to Ariel Procaccia and other prior instructions for slides CMU 15-7/381 CSPs Teachers: Ariel Prcaccia Emma Brunskill (THIS TIME) With thanks t Ariel Prcaccia and ther prir instructins fr slides Class Scheduling Wes 4 mre required classes t graduate A: Algrithms

More information

Populate and Extract Data from Your Database

Populate and Extract Data from Your Database Ppulate and Extract Data frm Yur Database 1. Overview In this lab, yu will: 1. Check/revise yur data mdel and/r marketing material (hme page cntent) frm last week's lab. Yu will wrk with tw classmates

More information

These tasks can now be performed by a special program called FTP clients.

These tasks can now be performed by a special program called FTP clients. FTP Cmmander FAQ: Intrductin FTP (File Transfer Prtcl) was first used in Unix systems a lng time ag t cpy and mve shared files. With the develpment f the Internet, FTP became widely used t uplad and dwnlad

More information

FIT 100. Lab 10: Creating the What s Your Sign, Dude? Application Spring 2002

FIT 100. Lab 10: Creating the What s Your Sign, Dude? Application Spring 2002 FIT 100 Lab 10: Creating the What s Yur Sign, Dude? Applicatin Spring 2002 1. Creating the Interface fr SignFinder:... 1 2. Creating Variables t hld values... 4 3. Assigning Values t Variables... 4 4.

More information

Report Writing Guidelines Writing Support Services

Report Writing Guidelines Writing Support Services Reprt Writing Guidelines Writing Supprt Services Overview The guidelines presented here shuld give yu an idea f general cnventins fr writing frmal reprts. Hwever, yu shuld always cnsider yur particular

More information

UNIT 9: Subtracting Two-Digit Numbers 2.NBT.5 2.NBT.6 2.NBT.9 2.MD.6 2.OA.1. UNIT 10: Place Value to 1,000

UNIT 9: Subtracting Two-Digit Numbers 2.NBT.5 2.NBT.6 2.NBT.9 2.MD.6 2.OA.1. UNIT 10: Place Value to 1,000 2 nd Grade SCOPE AND SEQUENCE (by Standard) 1 st Quarter (44 days) 2 nd Quarter (46 days) 3 rd Quarter (42 days) 4 th Quarter (48 days) Time, Graphs, and Data (embed thrughut year) 2.MD.7, 2.MD.9, 2.MD.10

More information

Quick start guide: Working in Transit NXT with a PPF

Quick start guide: Working in Transit NXT with a PPF Quick start guide: Wrking in Transit NXT with a PPF STAR UK Limited Cntents What is a PPF?... 3 What are language pairs?... 3 Hw d I pen the PPF?... 3 Hw d I translate in Transit NXT?... 6 What is a fuzzy

More information

1 Binary Trees and Adaptive Data Compression

1 Binary Trees and Adaptive Data Compression University f Illinis at Chicag CS 202: Data Structures and Discrete Mathematics II Handut 5 Prfessr Rbert H. Slan September 18, 2002 A Little Bttle... with the wrds DRINK ME, (r Adaptive data cmpressin

More information

Reading and writing data in files

Reading and writing data in files Reading and writing data in files It is ften very useful t stre data in a file n disk fr later reference. But hw des ne put it there, and hw des ne read it back? Each prgramming language has its wn peculiar

More information

Adobe InDesign: The Knowledge

Adobe InDesign: The Knowledge Adbe InDesign: The Knwledge Linda Trst Washingtn & Jeffersn Cllege Hints 1. Plan/design yur dcument s layut befre yu start placing text. 2. The first time yu call up Adbe InDesign CS, even befre yu pen

More information

B ERKELEY. Homework 7: Homework 7 JavaScript and jquery: An Introduction. Part 1:

B ERKELEY. Homework 7: Homework 7 JavaScript and jquery: An Introduction. Part 1: Hmewrk 7 JavaScript and jquery: An Intrductin Hmewrk 7: Part 1: This hmewrk assignment is cmprised f three files. Yu als need the jquery library. Create links in the head sectin f the html file (HW7.css,

More information

Log shipping is a HA option. Log shipping ensures that log backups from Primary are

Log shipping is a HA option. Log shipping ensures that log backups from Primary are LOG SHIPPING Lg shipping is a HA ptin. Lg shipping ensures that lg backups frm Primary are cntinuusly applied n standby. Lg shipping fllws a warm standby methd because manual prcess is invlved t ensure

More information

Paraben s Phone Recovery Stick

Paraben s Phone Recovery Stick Paraben s Phne Recvery Stick v. 3.0 User manual Cntents Abut Phne Recvery Stick... 3 What s new!... 3 System Requirements... 3 Applicatin User Interface... 4 Understanding the User Interface... 4 Main

More information

Stealing passwords via browser refresh

Stealing passwords via browser refresh Stealing passwrds via brwser refresh Authr: Karmendra Khli [karmendra.khli@paladin.net] Date: August 07, 2004 Versin: 1.1 The brwser s back and refresh features can be used t steal passwrds frm insecurely

More information

ROCK-POND REPORTING 2.1

ROCK-POND REPORTING 2.1 ROCK-POND REPORTING 2.1 AUTO-SCHEDULER USER GUIDE Revised n 08/19/2014 OVERVIEW The purpse f this dcument is t describe the prcess in which t fllw t setup the Rck-Pnd Reprting prduct s that users can schedule

More information

Chapter 6 Delivery and Routing of IP Packets. PDF created with FinePrint pdffactory Pro trial version

Chapter 6 Delivery and Routing of IP Packets. PDF created with FinePrint pdffactory Pro trial version Chapter 6 Delivery and Ruting f IP Packets PDF created with FinePrint pdffactry Pr trial versin www.pdffactry.cm Outline Cnnectin Delivery Ruting methds Static and dynamic ruting Ruting table and mdule

More information

3.1 QUADRATIC FUNCTIONS IN VERTEX FORM

3.1 QUADRATIC FUNCTIONS IN VERTEX FORM 3.1 QUADRATIC FUNCTIONS IN VERTEX FORM PC0 T determine the crdinates f the vertex, the dmain and range, the axis f symmetry, the x and y intercepts and the directin f pening f the graph f f(x)=a(x p) +

More information

Getting Started with the Web Designer Suite

Getting Started with the Web Designer Suite Getting Started with the Web Designer Suite The Web Designer Suite prvides yu with a slew f Dreamweaver extensins that will assist yu in the design phase f creating a website. The tls prvided in this suite

More information

Chapter 2 Basic Operations

Chapter 2 Basic Operations Chapter 2 Basic Operatins Lessn B String Operatins 10 Minutes Lab Gals In this Lessn, yu will: Learn hw t use the fllwing Transfrmatins: Set Replace Extract Cuntpattern Split Learn hw t apply certain Transfrmatins

More information

ISTE-608 Test Out Written Exam and Practical Exam Study Guide

ISTE-608 Test Out Written Exam and Practical Exam Study Guide PAGE 1 OF 9 ISTE-608 Test Out Written Exam and Practical Exam Study Guide Written Exam: The written exam will be in the frmat f multiple chice, true/false, matching, shrt answer, and applied questins (ex.

More information

Angles Lesson. Interwrite Interactive Mode software*. Sunshine State Standard: B.2.4.1, C.2.4.1

Angles Lesson. Interwrite Interactive Mode software*. Sunshine State Standard: B.2.4.1, C.2.4.1 Angles Lessn Sunshine State Standard: B.2.4.1, C.2.4.1 Materials: Students: Paper (lined), pencil, straight edge, prtractr, patty paper (Optinal: A cmputer with the use f GeGebra, dynamic gemetry sftware.)

More information

TRAINING GUIDE. Lucity Mobile

TRAINING GUIDE. Lucity Mobile TRAINING GUIDE The Lucity mbile app gives users the pwer f the Lucity tls while in the field. They can lkup asset infrmatin, review and create wrk rders, create inspectins, and many mre things. This manual

More information

wait on until ' for ECE 4514 Martin 2002 ECE 4514 Martin 2002 ECE 4514 Martin 2002 architecture begin : process begin end process;

wait on until ' for ECE 4514 Martin 2002 ECE 4514 Martin 2002 ECE 4514 Martin 2002 architecture begin : process begin end process; Last time VHDL in Actin Chapter 3 Cncurrent Statements Sequential cnstructs Lps: Fr/while Case If/then/elsif/else Prcess executin Sensitivity lists vs. wait statements Cmpund waits: wait n X,Y until ='0'

More information

The transport layer. Transport-layer services. Transport layer runs on top of network layer. In other words,

The transport layer. Transport-layer services. Transport layer runs on top of network layer. In other words, The transprt layer An intrductin t prcess t prcess cmmunicatin CS242 Cmputer Netwrks Department f Cmputer Science Wellesley Cllege Transprt-layer services Prvides fr lgical cmmunicatin* between applicatin

More information

CS4500/5500 Operating Systems Synchronization

CS4500/5500 Operating Systems Synchronization Operating Systems Synchrnizatin Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang UC. Clrad Springs Recap f the Last Class Multiprcessr scheduling Tw implementatins f the ready

More information

Principles of Programming Languages

Principles of Programming Languages Principles f Prgramming Languages Slides by Dana Fisman based n bk by Mira Balaban and lecuture ntes by Michael Elhadad Dana Fisman Lessn 16 Type Inference System www.cs.bgu.ac.il/~ppl172 1 Type Inference

More information

Lesson 4 Advanced Transforms

Lesson 4 Advanced Transforms Lessn 4 Advanced Transfrms Chapter 4B Extract, Split and replace 10 Minutes Chapter Gals In this Chapter, yu will: Understand hw t use the fllwing transfrms: Replace Extract Split Chapter Instructins YOUR

More information

Computer Organization and Architecture

Computer Organization and Architecture Campus de Gualtar 4710-057 Braga UNIVERSIDADE DO MINHO ESCOLA DE ENGENHARIA Departament de Infrmática Cmputer Organizatin and Architecture 5th Editin, 2000 by William Stallings Table f Cntents I. OVERVIEW.

More information

Using the Swiftpage Connect List Manager

Using the Swiftpage Connect List Manager Quick Start Guide T: Using the Swiftpage Cnnect List Manager The Swiftpage Cnnect List Manager can be used t imprt yur cntacts, mdify cntact infrmatin, create grups ut f thse cntacts, filter yur cntacts

More information

Solving Problems with Trigonometry

Solving Problems with Trigonometry Cnnectins Have yu ever... Slving Prblems with Trignmetry Mdeled a prblem using a right triangle? Had t find the height f a flagple r clumn? Wndered hw far away a helicpter was? Trignmetry can be used t

More information

Proper Document Usage and Document Distribution. TIP! How to Use the Guide. Managing the News Page

Proper Document Usage and Document Distribution. TIP! How to Use the Guide. Managing the News Page Managing the News Page TABLE OF CONTENTS: The News Page Key Infrmatin Area fr Members... 2 Newsletter Articles... 3 Adding Newsletter as Individual Articles... 3 Adding a Newsletter Created Externally...

More information