14 Pages

0225loop

Course: C 130, Fall 2009
School: St. Thomas
Rating:
 
 
 
 
 

Word Count: 851

Document Preview

130: CISC Today's Class Recap The Current Assignment Assignment Grades Handing In Assignments Do Loop Lab time, if time. 04/25/09 R. Smith - University of St Thomas - Minnesota 1 Recap Problem solving with functions Side Effects Scope of Variables Assignment 4 04/25/09 R. Smith - University of St Thomas - Minnesota 2 Notes on the Assignment READ the ASSIGNMENT! You get full credit ONLY if you...

Register Now

Unformatted Document Excerpt

Coursehero >> Minnesota >> St. Thomas >> C 130

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
130: CISC Today's Class Recap The Current Assignment Assignment Grades Handing In Assignments Do Loop Lab time, if time. 04/25/09 R. Smith - University of St Thomas - Minnesota 1 Recap Problem solving with functions Side Effects Scope of Variables Assignment 4 04/25/09 R. Smith - University of St Thomas - Minnesota 2 Notes on the Assignment READ the ASSIGNMENT! You get full credit ONLY if you meet all requirements Declare all the required functions use others if you want. Functions should behave as described in the assignment Input/output should occur as described Source code style: indenting and comments Use this style for each function! Include the "function header" comment from the assignment Put all variable declarations together at start Comment every variable declaration Don't just repeat the variable names in the comment Comment every 2-8 lines; blanks set off those lines Indent to show control flow ONLY R. Smith - University of St Thomas - Minnesota 3 04/25/09 Homework Grading Check plus check check minus - zero Basically, means about A-B-C (or zero) I post the grades on Blackboard Homework grades are CP-CH-CM-or Z If you get extra credit, you might see a number there. Blackboard prints numbers when words aren't enough There should also be a running total of your current grade This can fluctuate wildly if you don't hand in homework Comments on homework Handwritten on paper copy Posted to Blackboard if you only e-mailed your work. 04/25/09 R. Smith - University of St Thomas - Minnesota 4 Handing in C Homework E-mail me the source code file (filename.c) No spaces in the file name Include assignment number in file name Send as an Attachment "Subject" Line of the E-Mail ALWAYS include the course number CISC 130 When sending an assignment, include assignment number! When sending a question about class, say "Question about Class" or something like that (i.e. "Need help with ...") When 04/25/09 When sending an advisor question say "Advisor Question" R. Smith - University of St Thomas - Minnesota 5 Finishing the Assignment It is due at the end of the day Thursday We will work on it during Thursday Lab MAYBE later in this hour, if time I will be available Thursday afternoon IF people contact me and say they need me around If you're still struggling by the end of Thursday lab, let me know 04/25/09 R. Smith - University of St Thomas - Minnesota 6 Another thought about functions When we use functions, things are out of order The functions appear first Main is last. Functions are called in Main, or they are called in other functions It's like a show with many different Each acts act has its own script or music The players get their own scripts or music first Some acts are `one man shows' with one script Other acts have many players, scripts, music Main is "the show" It brings in the main acts ("functions") Some acts only happen when called on by other acts 04/25/09 R. Smith - University of St Thomas - Minnesota 7 Does recursion make sense? Problem: a calculation with repetition Fibonacci = successive additions Factorial = successive multiplications Powers of two = successive multiplications Is there a more obvious way? Yes, we can repeat statements until they pass an "if" like test 04/25/09 R. Smith - University of St Thomas - Minnesota 8 Repeating, based on a test We execute the first step Collects and initializes some variables Input X A=1 We execute the second step Does the calculation Does bookkeeping to see if we're finished A=A*2 X=X-1 True We test to see if we should repeat the second step We keep repeating until the test turns false X > 0? False Once false, we stop repeating that step 04/25/09 Print A R. Smith - University of St Thomas - Minnesota 9 The `do while' statement Syntax: do { statements ; } while ( expression ); 04/25/09 R. Smith - University of St Thomas - Minnesota 10 From the Flowchart X = getint(); A = 1; do { A = A * 2; X = X 1; while (X > 0); printf (" %d", A); 04/25/09 R. Smith - University of St Thomas - Minnesota 11 Do-While example Example Flowchart example Read a number X Calculate 2X Input controlled loop Read in a number Repeat loop that many ti...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

St. Thomas - CISC - 130
CISC 130: Today's Class Recap The Current Assignment Assignment Grades Handing In Assignments Do Loop Lab time, if time.04/25/09R. Smith - University of St Thomas - Minnesota1Recap Problem solving with functions Side Effects Scope o
St. Thomas - C - 130
CISC 130: Today's Class Recap For Loops Sentinel Loops Number Representation Lab 504/25/09R. Smith - University of St Thomas - Minnesota1Recap While Loops Nested Loops04/25/09R. Smith - University of St Thomas - Minnesota2For L
St. Thomas - CISC - 130
CISC 130: Today's Class Recap For Loops Sentinel Loops Number Representation Lab 504/25/09R. Smith - University of St Thomas - Minnesota1Recap While Loops Nested Loops04/25/09R. Smith - University of St Thomas - Minnesota2For L
St. Thomas - C - 210
CISC 210 - Class Today Homework: Chapter 5, exercises E6-E17 Recap Keystream reuse File EncryptionMarch 2005R. Smith - University of St Thomas - Minnesota1Recap Trojan horse a reason for file encryption Bob's defense What about Chain
St. Thomas - CISC - 210
CISC 210 - Class Today Homework: Chapter 5, exercises E6-E17 Recap Keystream reuse File EncryptionMarch 2005R. Smith - University of St Thomas - Minnesota1Recap Trojan horse a reason for file encryption Bob's defense What about Chain
St. Thomas - C - 210
CISC 210 - Class Today I've posted homework and chapters Recap Biometrics (yes, I found the Mythbusters DVD) (out of sync with previous presentation)04/25/09 R. Smith - University of St Thomas - Minnesota 1Recap Authentication Average Atta
St. Thomas - CISC - 210
CISC 210 - Class Today I've posted homework and chapters Recap Biometrics (yes, I found the Mythbusters DVD) (out of sync with previous presentation)04/25/09 R. Smith - University of St Thomas - Minnesota 1Recap Authentication Average Atta
St. Thomas - C - 210
CISC 210 - Class Today Return Homework; grading recap Enigma crypto exampleMarch 2005R. Smith - University of St Thomas - Minnesota1Homework Grading. Check plus check check minus - zero Basically, means about A-B-C (or zero) Check Plu
St. Thomas - CISC - 210
CISC 210 - Class Today Return Homework; grading recap Enigma crypto exampleMarch 2005R. Smith - University of St Thomas - Minnesota1Homework Grading. Check plus check check minus - zero Basically, means about A-B-C (or zero) Check Plu
Maryland - CMSC - 250
{}p%'i%wRQPQ% }jQ"uv z'"1'"jQbej'p}Q1Q"wu' }pe'rQE'd%jrr}p}Q"1}pe'rQE'v}StRri%EQ q & A$ hg 0 @ m$
St. Thomas - C - 230
QMCS 230: Today in Class Reading numbers from dialogs Converting the last lab to "dialogs" IF StatementMarch 2005R. Smith - University of St Thomas - Minnesota1/18Numeric Conversions Scanner class has built-in conversions JOptionPane ne
Pittsburgh - EXP - 414
Computer Supported Cooperative Work 10: 189209, 2001. 2001 Kluwer Academic Publishers. Printed in the Netherlands.189Computer Supported Social Networking For Augmenting Cooperation1 Department of Information Science and Intelligent Systems, Tok
Pittsburgh - SIS - 723
I NNOVATIONNEWST H E F O R E F R O N T O F E M E R G I N G T E C H N O L O G Y, R & D , A N D M A R K E T T R E N D SA Picture Worth 1,000 E-MailsT20Photo sharing emerges as one of the fastest-growing Web applications. BY WADE ROUSHhe intern
Pittsburgh - CS - 2710
CS 2710 Foundations of AI Lecture 1Course overviewMilos Hauskrecht milos@cs.pitt.edu 5329 Sennott SquareCS 2710 Foundations of AIM. HauskrechtCourse administriviaInstructor: Milos Hauskrecht 5329 Sennott Square milos@cs.pitt.edu TA: Tomas
Pittsburgh - MATH - 0240
' j @ r Y Y` G h Q V Q rT FT V S r F G q Q l T T FT G F GT q F Y Q rT rT Q #{AdC6CaI4vCp0CpW!aIU!dC#EC|EEa6aCW!6#WpCCCpWaC|l 8 I3rv3x43I!w00WIa!CCd#EbCpvU#EUEC|0Ir" d{IECIV j 5 j 5 1 $ " e rT F GT q F Y r G q Q S G
Maryland - HONR - 278
Life history and longevity Population ecology Life history evolution Reproductive value Longevity and senescenceDiscussion Readings Kirkwood, T.B.L. and Austad, S.N. 2000 Why do we age? Nature 408:233-238. Perez-Campo, R., M. Lopez-Torres, S.
Maryland - L - 278
Life history and longevity Population ecology Life history evolution Reproductive value Longevity and senescenceDiscussion Readings Kirkwood, T.B.L. and Austad, S.N. 2000 Why do we age? Nature 408:233-238. Perez-Campo, R., M. Lopez-Torres, S.
Pittsburgh - ENGR - 0715
Proposal toOakland Transportation Management Association for the Redesign of Online Transient Parking MapA project for Engineering 0715 Engineering Applications for SocietyFebruary 3, 2009Bruk Berhanu.. brb71@pitt.edu Jiaqi Gu. jig19@pitt.edu
Toledo - ENV - 200
the promises of biotechnologyThe self-described 2nd green revolution What was the 1st green revolution?Changes in agricultural practice in the 1960s and 70s Raised productivity of 3 primary crops (rice, corn, wheat) partly through new plant varieti
Pittsburgh - IS - 2420
PARSING WITH CONTEXT-FREE GRAMMARS PARSING AS SEARCH "through the space of all possible parse trees" ? "defined by the grammar" including partial trees. or: the space of all possible sequences of rule applications (leading to complete parse trees)? t
East Los Angeles College - MAF - 206
BEEM117 Economics of Corporate Finance Weeks 4,5&6: Asymmetric Information II: Moral Hazard Aims: This topic will introduce students to the concept of moral hazard and its consequence to contracts. We will cover the basic principal-agent model, whils
CSU Fullerton - BTP - 500
Mathematical Review: Exponents: x a x b = x a +b xa = x a b b x(x )a b= x abx n + x n = 2 x n x 2n 2 n + 2 n = 2 n +1 Logarithms (note, unless otherwise stated, log is log2) Definition: x a = b iff log x b = a log a b = log c b ;c > 0 log c
UC Davis - SS - 0809
Chapter 9: Genetics Key Terms Genetics Heredity Law of Segregation Law of Independent Assortment Gene Allele Dominant Recessive Homozygous Dominant Homozygous Recessive Heterozygous Genotype Phenotype Monohybrid Cross Trisomy
UT Arlington - CSE - 1111
Demonstration of Computer Use Proficiency in CSE 1111 As of Fall 1999, UT Arlington requires each student to demonstrate proficiency in computer use. This proficiency is interpreted by the university as the ability to do certain tasks, listed below.
UT Arlington - EE - 5361
Michigan - AE - 245
AE 245 homework #6 solutionsTim Smith 15 March 20001 Problem 1The Hubble Space Telescope was placed in a circular orbit about the Earth at an altitude of 330 mi. Identify the following orbital characteristics: 1. What is the circular velocity of
Pittsburgh - EPI - 2670
The Global Burden of InjuriesThomas Songer, PhD University of PittsburghWhat are Injuries?Injuries occur as the result of energy transfer that is delivered in excess of a thresholdHow do we measure injuries?Documents used to Record Injuries
UT Arlington - OPMA - 6371
Journal of Operations Management 17 Z1999. 343358Methodological noteA review of operations management studies using scale development techniquesRhonda L. Hensley) North Carolina A & T State Uniersity, Department of Business Administration, Scho
UT Arlington - OPMA - 6371
Journal of Operations Management 18 Z2000. 361374 www.elsevier.comrlocaterdswMethodological NoteMeasurement issues in empirical research: improving measures of operations strategy and advanced manufacturing technologyKenneth K. Boyerba,), M
CSU Fullerton - UNX - 122
Winter2002UNX122Test2JimChowSenecaCollegeofAppliedArtsandTechnology SchoolofComputerStudiesTEST#2aSEMESTER Winter2002 Name: StudentNo: Date: Duration: Saturday,April25,2009 OnePeriod SUBJECT OperatingSystemsUNIX CODE/Sectio n UNX122IQuesti
Maryland - EB - 237
Forage Crop DiseasesDisease management in perennial forage crops is based on planting locally adapted, disease-resistant cultivars and using good cultural practices to help reduce losses from diseases. Disease resistance ratings of alfalfa cultivars
UT Arlington - CSE - 1311
Pointers and ArraysDarin Brezeale The University of Texas at ArlingtonPointers and Arrays p. 1/20Arrays, Part 2We have already learned how to work with arrays using subscript notation. Example:float myData[] = {3.5, 4.0, 9.34}; myData[0] += 2
Toledo - PHY - 180
PHYSICS 180 Problem set #1 Solutions1) A small glass of water is approximately 5 cm tall and so water evaporates at about 1/2 cm/day on average from an open surface. About 2/3 of the Earths surface is covered by water and so in one year, the height
UT Arlington - CSE - 1311
PointersDarin Brezeale October 12, 20081IntroductionA pointer is a variable whose value is the address of another variable [Pet97]. Hence we think of them as `pointing' to another variable. Knowing the specific address of a variable is typical
Toledo - PHY - 180
PHYSICS 180 Problem set #7 Due: 5 PM, Monday, Nov.5th, 2007"Experience is the name everyone gives to their mistakes." -Oscar Wilde (1854-1900)1) A 2007 Toyota Corolla-XE with a mass of 1.0x103 kg accelerates from rest in a straight line using a co
Maryland - PHYS - 141
PHYS 141 Webassign #22008.09.19Problem 6 (4.014)A firefighter a distance d from a burning building directs a stream of water from a fire hose at angle i above the horizontal as in the figure. If the initial speed of the stream is vi , at what he
Michigan - MATH - 105
Math 105 Mathematical Skills and Knowledge for Uniform Exam #2 Exponential Functions Fall 2004You need to be able to remember the functional form of the formula for an exponential function: f (x) = A " B x . If you are given the x- and y-coordina
UT Arlington - CHEM - 1442
1.For the reaction A(g) + 2B(g) 2C(g) + 2D(g)5.The equilibrium constant, Kp, for the reaction CO(g) + H2O(g) CO2(g) + H2(g)the following data was collected at constant temperature. Determine the correct rate law for this reaction. Trial 1 2 3
UT Arlington - EE - 3308
The University of Texas at Arlington Department of Electrical Engineering EE3308-001 Spring 2009 Homework #1 Due February 3, 2009 From David K. Cheng Field and Wave Electromagnetic 2nd ed. (1989) (Cheng2) Problem 1. Verify equation 2-145 using formul
UT Arlington - EE - 2303
Last Name:First NameID:xxxx-xx_.University of Texas at Arlington EE 2303 Fall 2005 Exam I (October 20, 2005) Time allotted 80 minPRINT YOUR NAME in CAPITAL LETTERS. Last NAME: INSTRUCTIONS: 1) Work independently. No help from others. Cheating
Oregon State - ECE - 474
Multiplier Requirements Document1.0 Revision Historyver 1.0 8/5/01 - Original draft ver 1.1 3/31/05 - First Revision -xed typos, pin denitions, added timing table ver 1.2 4/6/05 - Fixed MSB/LSB typo in pin denition table -altered timing table value
Oregon State - ECE - 474
Allan Hancock College - CIVL - 2201
School of Civil Engineering CIVL2201 Structural MechanicsLaboratory Instructions Material Properties General Instructions Students will experience basic material property testing in this demonstration. In the tutorial session of Thursday 20 March
Pittsburgh - ENGR - 1247
EE 1247Semiconductor Device TheorySpring 2005Due (before lecture): 2/21/05Homework #6, assigned 2/14/05 Problems:1) Book: 5.1 (a) to (i). 2) Book 5.6 [use NA =21015 /cm3; ND = 1015 /cm3; VA = 0]; Sketch by hand and approximately to scale, a
Pittsburgh - PHYS - 202
NAME QUIZ 6 (PLEASE SHOW ALL WORK)KEY1. (10pts) A cubical Gaussian surface is placed in a uniform electric eld as shown in the gure. The length of each edge of the cube is 1:0 m. The uniform electric eld has magnitude 5:0 108 N=C and passes throu
Pittsburgh - PHYS - 202
NAME QUIZ #03 (PLEASE SHOW ALL WORK)KEY1. (20pts) A train moving at a constant speed is passing a stationary observer on a platform. On one of the train cars, a ute player is continually playing the note known as concert A (f = 440 Hz). After th
Pittsburgh - PHYS - 202
NAMEKEYPHYSICS 0202 EXAM 2 (SPRING 08) PLEASE SHOW ALL WORK so partial credit can be given. The last page is the formula sheet, tear it o and use it as needed. Total points = 100. 1. (5pts) The .gure shows the path of a ray of light as it travels
Allan Hancock College - ENGG - 1802
ENG18022007Assignment 1 (Statics)Due by 5:00pm Friday 14 September 2007(10%) You MUST complete these assignment questions independently. When you submit your assignment, a statement page with your signature must be attached to show that "This i
Michigan - CHEM - 260
Quiz KeyChapter 1 (Gases)Chem 200 Lecture (Sharp, 2 PM) (5 pts total)I. Intermolecular forces1. Which of the following quantities increases in a regular manner down the series He < Ne < Ar < Kr < Xe ? (Circle each correct answer: Grading: 3 o
UT Arlington - EE - 4343
F.L. Lewis Friday, July 17, 1998 Prepared by: F.L. LewisVersion: Friday, July 17, 1998 Report: Mech 4Vehicle Mechanical Subsystem Feedback DesignWe consider here only the mechanical subsystem of the 1/4 vehicle, with no strut dynamics. This all
UT Arlington - EE - 4343
Copyright F.L. Lewis 2003 All rights reservedEE 4343/5329 - Control System Design ProjectDominant Mode ApproximationThough most systems of interest are of higher order, they often have a dominant mode, which is a complex pole pair of lower freq
UT Arlington - EE - 4343
Copyright F.L. Lewis 1999 All rights reservedEE 4343/5329 - Control System Design Projectupdated: Monday, August 02, 1999OUTPUT FEEDBACK DIGITAL INVERTED PENDULUM DESIGN1234567
UT Arlington - EE - 4343
Copyright F.L. Lewis 1999 All rights reservedEE 4343/5329 - Control System Design Projectupdated: Monday, August 02, 1999OUTPUT FEEDBACK DESIGN12345678
UT Arlington - EE - 4343
Copyright F.L. Lewis 1999 All rights reservedEE 4343/5329 - Control System Design Projectupdated: Monday, August 02, 1999OUTPUT FEEDBACK INVERTED PENDULUM DESIGN1234567
UT Arlington - EE - 4343
Copyright F.L. Lewis 1999 All rights reservedEE 4443/4329 - Control Systems Design ProjectLECTURE 1Updated:Tuesday, June 15, 2004STATE VARIABLE (SV) SYSTEMSA natural description for dynamical systems is the nonlinear state-space equation& x
UT Arlington - EE - 4343
F.L. Lewis Friday, July 17, 1998 Prepared by: F.L. LewisVersion: Friday, July 17, 1998 Report: Mech 3Vehicle Mechanical Subsystem Static FeedbackPassive Damping (feedback of suspension velocity) & & u = K d ( z s zu ) = K d ( x2 x4 ) Suspen
Oregon State - EXAM - 735
WHAT ARE THE THREE COMPONENTS OR PHASES OF DRUG DESIGN? WHAT OCCURS DURING EACH PHASE? WHAT ASPECTS OF DRUG DESIGN MUST BE MET FOR A LEAD CANDIDATE TO BECOME A CLINICAL CANDIDATE?HOW LONG DOES IT TAKE TO PRODUCE 1 DRUG MOLECULE FROM 10,000 DRUG CAN
Pittsburgh - MATH - 23032
Integrated Calculus II Exam I Friday 7th February 2003Name: Show your work Each question is worth 20 points. The best five questions will count. SignatureQuestion 1Give an appropriate substitution for the following integral:2t2 (2t3 + 9)3 dt.
Pittsburgh - MATH - 23014
Honors Calculus Quiz 6 Solutions 10/10/3Question 1Let A, B and C be points in space with the following position vectors: A = [6, -3, 2], B = [9, -3, 6], C = [10, -7, 0]. Find the vector equation of the line AB. The vector equation, with parameter
Pittsburgh - MATH - 024
Integrated Calculus I Quiz 5 Solutions, 4/9/4 Question 12 A particle is moving along the curve with equation xy 2 - y = 3. At a certain time, the particle is at the point (1, 2) on the curve and has for its x-component of its velocity dx = 4. dt Fin
Pittsburgh - MATH - 024
Integrated Calculus I Exam 1 Solutions, 2/6/4 Question 1Find the derivatives of the following functions. Dont take the time to simplify your answers: t3 t + 1 . a(t) = 1 2t We use the division rule: da (3t2 1)(1 2t) (t3 t + 1)(2) = dt (1 2t)