CSE 113 Week 5 February 11 - 15, 2008. Announcements  Module 2 due 2/15  Exam 3 is on 2/15  Module 3 due 2/22  Exam 4 is on 2/25  Module 4 due 2/29.

Slides:



Advertisements
Similar presentations
Repetition Statements Perform the same task repeatedly Allow the computer to do the tedious, boring things.
Advertisements

Karel – Chapter 6 Instructions That Repeat
RAPTOR Syntax and Semantics By Lt Col Schorsch
1 CS100J February 28, 2006 Loops, iterative statements, or repetitive statements A bit about graphics From news.com, on 23 February 2006, about browser.
Picture Manipulation The manipulation of (already created) pictures. May be applied to vector graphics or bitmaps. We will consider bitmaps and introduce.
CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
Repeating Actions While and For Loops
Executes a statement or statements for a number of times – iteration. Syntax for(initialize; test; increment) { // statements to be executed } Initial.
1 9/28/07CS150 Introduction to Computer Science 1 Loops section 5.2, 5.4, 5.7.
CSI 101 Elements of Computing Spring 2009 Lecture # 8 Looping and Recursion Wednesday, February 25 th, 2009.
Loops – While, Do, For Repetition Statements Introduction to Arrays
CSE 115 Week 12 March 31 – April 4, Announcements March 31 – Exam 8 March 31 – Exam 8 April 6 – Last day to turn in Lab 7 for a max grade of 100%,
Week 11 Recap CSE 115 Spring Want to write a programming language? You’ll need three things: You’ll need three things: –Sequencing –Selection Polymorphism.
Copyright © Texas Education Agency, Computer Programming For Loops.
New Mexico Computer Science For All More Looping in NetLogo Maureen Psaila-Dombrowski.
Simple Python Loops Sec 9-7 Web Design.
Image Processing & Perception Sec 9-11 Web Design.
Loops: Handling Infinite Processes CS 21a: Introduction to Computing I First Semester,
CSC1401 Viewing a picture as a 2D image - 1. Review from the last week We used a getPixels() to get all of the pixels of a picture But this has been somewhat.
1 CS1110, 8 March 2009 Two topics: elementary graphics (for A5); loops Reading: Sec and chapter 7 on loops. The lectures on the ProgramLive CD can.
Repetition Statements.  Often it is necessary to repeat statements many times  Java has two ways of doing this  while statements  for statements.
Visual Basic.net Loops. Used to do multiple executions of the same block of code Do while loops Do until loops For next loops.
Coding Design Tools Rachel Gauci. What are Coding Design Tools? IPO charts (Input Process Output) Input- Make a list of what data is required (this generally.
Lecture 4 Looping. Building on the foundation Now that we know a little about  cout  cin  math operators  boolean operators  making decisions using.
1 09/20/04CS150 Introduction to Computer Science 1 Let ’ s all Repeat Together.
 A spreadsheet is a type of software which you can put and sort out data. It is also known as ‘Microsoft Excel’ What is a spreadsheet?
TOPIC 6 MODIFYING PICTURES USING LOOPS 1 Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and.
February ,  2/16: Exam 1 Makeup Papers Available  2/20: Exam 2 Review Sheet Available in Lecture  2/27: Lab 2 due by 11:59:59pm  3/2:
Loops Robin Burke IT 130. Outline Announcement: Homework #6 Conditionals (review) Iteration while loop while with counter for loops.
Lesson 3: Arrays and Loops. Arrays Arrays are like collections of variables Picture mailboxes all lined up in a row, or storage holes in a shelf – You.
For Code Next For Code Next A loop is a segment of a code that repeats (changing slightly each time)
Counting Loops.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
Repetition Control Structure. Introduction Many applications require certain operations to be carried out more than once. Such situations require repetition.
Computer Science 320 Parallel Image Generation. The Mandelbrot Set.
CSD 340 (Blum)1 For Loops See Beginning JavaScript (Paul Wilton) p. 87.
04-ManipulatingPictures-part21 Manipulating Pictures, Arrays, and Loops part 2 Barb Ericson Georgia Institute of Technology June 2008.
TOPIC 8 MORE ON WHILE LOOPS 1 Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson,
Chapter 5: Matrices and Determinants Section 5.5: Augmented Matrix Solutions.
Week 3.  TO PRINT NUMBERS FROM 1 TO 20  TO PRINT EVEN NUMBERS FROM 1 TO 20 2.
Loops causes program to execute the certain block of code repeatedly until some conditions are satisfied. Suppose you want to execute some code/s 10 times.
Topic : While, For, Do-While Loop Guided By : Branch : Batch :
Barbara Ericson Georgia Tech Sept 2005
Manipulating Pictures, Arrays, and Loops part 2
Manipulating Pictures, Arrays, and Loops part 2
Topic 6 Modifying Pictures Using Loops
Image Processing & Perception
Think What will be the output?
CE 311 K - Introduction to Computer Methods Daene C. McKinney
Manipulating Pictures, Arrays, and Loops part 2
Repetition and Loop Statements
Color Values All colors in computer images are a combination of red, green and blue Each component is encoded as a number means the color is.
CSC115 Introduction to Computer Programming
Please use speaker notes for additional information!
Programming for Artists
Gray Scale picture def pixBW(pixel): # given a pixel, change to BW
Chapter (3) - Looping Questions.
Chapter 15, Images …a few points
Alternate Version of STARTING OUT WITH C++ 4th Edition
CS 177 Week 3 Recitation Slides
CSC1401 Viewing a picture as a 2D image - 2
February , 2009 CSE 113 B.
Manipulating Pictures, Arrays, and Loops
Repetition Statements (Loops) - 2
Little Man Computer (continued).
CSC1401 Manipulating Pictures 2
Week 7: Computer Tools for Problem Solving and Critical Thinking
JavaScript 101 Lesson 8: Loops.
Module 4 Loops and Repetition 9/19/2019 CSE 1321 Module 4.
Presentation transcript:

CSE 113 Week 5 February , 2008

Announcements  Module 2 due 2/15  Exam 3 is on 2/15  Module 3 due 2/22  Exam 4 is on 2/25  Module 4 due 2/29

Highlights  What if we wanted to change all of the pixels in a picture to black?  We need to access all of the pixels of the picture one at a time and then change their color to black.

Highlights  We can’t do this simply by inputting each coordinate of the pixels and changing them, because it only works for certain images, not all images.  What we want to do is repeat the process of getting a pixel and changing its color.

Highlights  We need a way to help us repeat.  Repetition is a key element of computation.  One way to have a program repeat is to add a loop to our program.  The loop we will look at first is a for- loop

Highlights  The for-loop is a counting loop, so much of the syntax needed helps us to set up the counting of how many times the loop should repeat.  For-loop syntax for(initialization; test; increment) { //loop body }

Highlights  initialization Create a variable that is our loop counter and give it a starting value  test Test to tell us when to stop the counting  increment Increments the counter after each time the loop body is executed

Highlights  We can start a count with the first pixel in a row/column and continue counting until the end of the row or column  Remember that we can tell the width and height of a picture by calling the appropriate methods on it

Highlights  In order to go through all the pixels (width x height), we will need a system of two loops, one that loops through the columns, and the other that loops through the rows.  Putting them together allows us to go through all the rows and columns in the picture.