Iteration Statements CGS 3460, Lecture 18 Feb 20, 2006 Hen-I Yang.

Slides:



Advertisements
Similar presentations
Introduction to C Programming
Advertisements

BEGIN THE FIRST DAY OF CLASS. Know what's expected of you Take notes from the first day even if it's routine stuff you think you already know. How to get.
An Object-Oriented Approach to Programming Logic and Design
 Instructor Nash  Readings: Savitch, Chapter 3 (Section 3)  CSS 161 V2.0.
Computer Science 1620 Loops.
AdvWeb-1/14 DePaul University SNL 262 Advanced Web Page Design Chapt 8 - Looping Instructor: David A. Lash.
1 CSI 101 Elements of Computing Fall 2009 Lecture #4 Using Flowcharts Monday February 2nd, 2009.
Chapter 8 (Control Structure) Slide 1 Control Structures Control structures are used by the programmer to incorporate the desired sequence of execution.
Chapter 5: Control Structures II (Repetition)
16/27/ :53 PM6/27/ :53 PM6/27/ :53 PMLogic Control Structures Arithmetic Expressions Used to do arithmetic. Operations consist of +,
Modern Optics Lab Modern Optics Lab Introductory Meeting.
PROGRAMMING In Lesson 5. RECAP  Complete the starter activity.
Next class session: Test 1 on all sections covered from Chapters 1 and 2 Remember: If you haven’t yet passed the Gateway Quiz, you need to review your.
CHAPTER 7: SORTING & SEARCHING Introduction to Computer Science Using Ruby (c) Ophir Frieder at al 2012.
Chapter 5: Control Structures II (Repetition)
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 5: Control Structures II (Repetition)
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note-taking materials. Today’s daily quiz will be given at the.
Get the most information out of the time you have available.
Log into your account Go to Locate MAT 2401 and the First Day PPT.
MAT 0145 College Readiness Math II Spring 2015
EGR 2261 Unit 5 Control Structures II: Repetition  Read Malik, Chapter 5.  Homework #5 and Lab #5 due next week.  Quiz next week.
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note- taking materials.
Loops CS 103 February 19, 2007 Presented by Nate.
Slide 3-1 CHAPTER 3 Conditional Statements Objectives To learn to use conditional test statements to compare numerical and string data values To learn.
Reading Skills 101 Reading quiz! Time to get over your summer hang over!
Reviewing for Gateway #2 The second Gateway Quiz will be given at the next class session, after we review for Quiz 2 on sections If you have already.
1 Flowchart notation and loops Implementation of loops in C –while loops –do-while loops –for loops Auxiliary Statements used inside the loops –break –continue.
Principles of Computer Science I Honors Section Note Set 1 CSE 1341 – H 1.
CSc2310 tutoring session, week 8 Fall, 2012 Haidong Xue 5:30pm—8:30pm 11/06/2012 and 11/07/2012 -Test 3 Study Guide.
C++ crash course Class 8 statements, sort, flight times program.
Linked Lists part 2 CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and Computer Science University.
Lecture 4 Looping. Building on the foundation Now that we know a little about  cout  cin  math operators  boolean operators  making decisions using.
Control Structures II (Repetition). Objectives In this chapter you will: Learn about repetition (looping) control structures Explore how to construct.
CSE 425: Control Flow I Categories of Control Flow Constructs Sequencing –order of expressions and statements Selection –if, else, switch Iteration –loops.
Welcome to CS61A Disc. 29/47 :D Dickson Tsai OH: Tu, Th 4-5pm 411 Soda Previous stop: None >>> Today: Working effectively in.
Advanced Computer Science Lesson 4: Reviewing Loops and Arrays Reading User Input.
Iteration Statements CGS 3460, Lecture 17 Feb 17, 2006 Hen-I Yang.
CSCE 121: Introduction to Program Design and Concepts Dr. J. Michael Moore Spring 2015 Set 4: Computation 1 Based on slides created by Bjarne Stroustrup.
Physics 1B3-summer Lecture 11 Welcome to Physics 1B03 !
CMSC 2021 CMSC 202 Computer Science II for Majors Spring 2002 Sections Ms. Susan Mitchell.
1/17/2016B.Ramamurthy1 Final Review CSE321 B.Ramamurthy.
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note- taking materials.
Basic Types CGS 3460, Lecture 19 Feb 22, 2006 Hen-I Yang.
CPSC 217 T03 Week V Part #1: Iteration Hubert (Sathaporn) Hu.
Summary CGS 3460, Lecture 43 April 26, 2006 Hen-I Yang.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 5: Control Structures II (Repetition)
REMINDER: If you haven’t yet passed the Gateway Quiz, make sure you take it this week! (You can find more practice quizzes online in the Gateway Info menu.
Beginning C For Engineers Fall 2005 Lecture 3: While loops, For loops, Nested loops, and Multiple Selection Section 2 – 9/14/05 Section 4 – 9/15/05 Bettina.
1 Project 7: Looping. Project 7 For this project you will produce two Java programs. The requirements for each program will be described separately on.
Arrays and Loops. Learning Objectives By the end of this lecture, you should be able to: – Understand what a loop is – Appreciate the need for loops and.
Today… Python Keywords. Iteration (or “Loops”!) Winter 2016CISC101 - Prof. McLeod1.
REMINDER: If you haven’t yet passed the Gateway Quiz, make sure you take it this week! (You can find more practice quizzes online in the Gateway Info menu.
C++ Programming: CS102 LOOP. Not everything that can be counted counts, and not every thing that counts can be counted. −Albert Einstein Who can control.
CSE 220 – C Programming Loops.
Do now Please take a “First Day of School Questionnaire” and begin filling it out. Whatever is not completed at the beginning of class must be completed.
Introduction To Repetition The for loop
Lecture 4B More Repetition Richard Gesick
Iteration with While You can say that again.
CISC101 Reminders Quiz 1 grading underway Assn 1 due Today, 9pm.
Do now Please take a “First Day of School Questionnaire” and begin filling it out. Whatever is not completed at the beginning of class must be completed.
Chapter 4 Loops While loop The for loop do… while break and continue
CSC215 Lecture Flow Control.
CSC215 Lecture Control Flow.
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
Chapter 5: Control Structures II (Repetition)
EECE.2160 ECE Application Programming
CSC215 Lecture Control Flow.
EECE.2160 ECE Application Programming
EECE.2160 ECE Application Programming
Presentation transcript:

Iteration Statements CGS 3460, Lecture 18 Feb 20, 2006 Hen-I Yang

Previously… for statement Break, continue statement

Agenda About quiz 1 goto statement Null statement

Questions about Quiz 1 Grading policy How does that affect your grade? Should you be alarmed? What do you need to do to better prepare for quiz 2 Answer key to quiz 1 will be posted later today.

Questions about Quiz 1 How do quizzes affect your grade? (25) 80% or above: You'll get whatever you receive for the homework (40) 60% -- 79%: You'll get 90% of what you receive for the homework (11) 50% -- 59%: You'll get 80% of what you receive for the homework (3) 40% -- 49%: You'll get 60% of what you receive for the homework (1) 39% or below: you'll get 60% of what you receive for the homework. (pending code review) Average: 73, Max: 96, Min: 31, 81.25% will get 90% of above as scaling factor

Questions about Quiz 1 Should you be alarmed? If you get more than 80%, you’re probably ok. If majority of point deduction comes from problem 1, you’re probably ok. If you get less than 50%, or if you lost more than a combined of 10 points in problem 2 and 3, or loss 15 points in problem 4. There’s a warning sign. How do you interpret the result of quiz 1

Questions about Quiz 1 What do you need to do to better prepare for quiz 2? It’s not just homework, you have to understand the material. Study all the materials I tell you will be in the quiz. Do not randomly guess an answer, some questions bare penalties. I’ll adopt a less strict penalty in grading policy starting from quiz 2.

Questions about Quiz 1 How do I request regrading? There is a regrading request form that will be posted online later today.regrading request form Fill it out electronically, and submit electronically to with subject [CGS3460] Quiz 1 regrading request TA/grader will arrange to discuss with you. There is an explicit grading policy issued. Unless there are clear errors or problem with grades summation, random requests probably will not change your grade. In case you request a second appeal, bring the same form to see me. I will not have the discussion until the form has already been discussed/signed by the TA/grader.

A Glimpse of Quiz 2 What is in Quiz 2?  Everything related to Homework2  Everything in the textbook up to Section 5-2  Everything listed on the “topics” page up to Feb 10 About Quiz 2  Bring Gator 1 ID  15 minutes starting 9:35 am sharp  No electronic device of any sort is allowed  To have homework 2 counted toward your grade, you have to take quiz 2.  Lecture will continue after the completion of the quiz

Miscellaneous/Update Homework 2 Clarification  EPA and fuel efficiency calculation  How to print strings/tags/message properly using conversion specifications? print_string.c Homework 1 will be returned later this week

Throw in the Towel Break;  Find it! Abort search  User input causes stop  Good for exiting in the middle  Work on the innermost statement, only exits one level Continue;  Not interested.  Skip the rest of the loop, and go directly to the next  Remain inside the loop  Continue can only be used for loop, not switch  e.g. add 0 (from user’s input)

Throw in the Towel (II) Goto:  BAD BAD BAD idea goto label; label: statement  Bad habit from Basic  Unstructured. Both break and continue are restricted, but not goto  Use goto to emulate break;  Use goto for multi-level break?  Spaghetti code (Hard to read, hard to modify) return; exit();  to be discussed later

Null statement ; Empty loop body At the end of compound statement A line by itself to avoid confusion Putting ; after () in if, while or for will ends the statemen

Sample Code.... ….... …...….

STAGE 3 We have discussed about the components/elements of the program We talked about how to analyze/design a program. You have been introduced to basic operators. You are now familiar with most frequently used statements. Formatted input/output, expressions, selection and iteration. You should be able to write descent C programs by now. (and you will, in homework 3)

STAGE 3 We are moving on the more advance materials now. Types: What are they, why are they important Arrays: Tired of declaring 10 variables for 10 entries of the same thing? Functions: How do we pack code segments into something more meaningful? Pointers: Let the fun begins.

Summary Goto statement Null statement

Before you go Read Chapter 6. Homework 2 due tomorrow (Feb 21, Tuesday at 11:59 pm)