Download presentation
Presentation is loading. Please wait.
Published byVictoria Dickerson Modified over 9 years ago
1
Iteration Statements CGS 3460, Lecture 18 Feb 20, 2006 Hen-I Yang
2
Previously… for statement Break, continue statement
3
Agenda About quiz 1 goto statement Null statement
4
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.
5
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
6
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
7
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.
8
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 cgs3460sp06@cise.ufl.edu with subject cgs3460sp06@cise.ufl.edu [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.
9
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
10
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
11
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)
12
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
13
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
14
Sample Code.... ….... …...….
15
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)
16
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.
17
Summary Goto statement Null statement
18
Before you go Read Chapter 6. Homework 2 due tomorrow (Feb 21, Tuesday at 11:59 pm)
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.