# Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

2 Pages

### Quiz6-KEY

Course: COSC 235, Fall 2009
School: Wofford
Rating:

Word Count: 319

#### Document Preview

235B David COSC A. Sykes Quiz 6 April 18, 2008 1. Show the output of the program on the second sheet given the following user inputs [bold]: Welcome to the frog simulation. Enter the depth of the well: 10 Enter the height of the frog above the bottom: 5 Enter the distance the frog hops up during a day: 3 Enter the distance the frog slides down during a night: 1 Day 1: 8 , night: 7 Day 2: 10 Escape requires 2...

Register Now

#### Unformatted Document Excerpt

Coursehero >> South Carolina >> Wofford >> COSC 235

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.
235B David COSC A. Sykes Quiz 6 April 18, 2008 1. Show the output of the program on the second sheet given the following user inputs [bold]: Welcome to the frog simulation. Enter the depth of the well: 10 Enter the height of the frog above the bottom: 5 Enter the distance the frog hops up during a day: 3 Enter the distance the frog slides down during a night: 1 Day 1: 8 , night: 7 Day 2: 10 Escape requires 2 days. 2. Draw a structure chart for the program. depth position hopUp slideDown main days depth position hopUp slideDown getSimParameters prompt lo hi value sim getValue 3. Describe what a unit test is. A unit test is a program that checks to see if a function does what it is supposed tothat is, it behaves according to its specification. 4. Write an expression that produces a random number in the range 1..6, inclusive. random.randrange(1,7) Key Name: _____________________________ Pledged: _____________________________ COSC 235B David A. Sykes def sim(depth, h, up, down): pos = h day = 0 while pos < depth: day += 1 # Climb up during the day pos += up print "Day %d: %3d" (day, % pos), # Slide down during the night, unless already out if pos < depth: # Still in the well pos = max(pos-down, 0) print ", night: %3d" % (pos), print return day def getValue(prompt, lo, hi): "Issue a prompt and accept input in the range lo..hi" value = input(prompt) while value < lo or value > hi: value = input(" Enter a value in the range %s..%s: " % (lo, hi)) return value def getSimParameters(): print "Welcome to the frog simulation." depth = getValue("Enter the depth of the position = getValue("Enter the height of 0, depth) hopUp = getValue("Enter the distance the 0, 10000) slide...

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:

Wofford - COSC - 235
COSC 235BDavid A. SykesQuiz 8May 2, 20081. Show the output produced by the following interaction with the Python shell.IDLE 1.2.1 &gt; lst = [ 11, 2, 37, 25, 10 ] &gt; lst[1]2&gt; lst.append(9) &gt; lst[11, 2, 37, 25, 10, 9]&gt; 7 in lstFalse&gt; lst.i
Allan Hancock College - ACOLS - 127
Dao127-+Talk-+Spectral Analysis of 2-Colour 3-Pulse Photon Echoes on a Femtosecond Time Scale-+AbstractThe spectral analysis of photon echo signals is used to study a semiconductor-doped glass and a laser dye (RhB) in methanol solution. The d
Wofford - ECO - 301
Eco 301 Problem Set 12Name_ 10 December 20081. The demand curve for a monopolist is given by P = 350 - 7Q, and the short-run total cost curve is given by TC = 500 + 70Q. What is the profit-maximizing price and quantity? Find the monopolist's econ
Allan Hancock College - ZWSAP - 2004398
Published in Gazette 6.5.2004 p 1225South AustraliaZero Waste SA Act (Commencement) Proclamation 20041-Short titleThis proclamation may be cited as the Zero Waste SA Act (Commencement) Proclamation 2004.2-Commencement of ActThe Zero Waste SA
Allan Hancock College - NPAWWCPRP - 2007771
Published in Gazette 22.3.2007 p 869South AustraliaNational Parks and Wildlife (Bascombe WellConservation Park-Mining Rights) Proclamation 2007under section 43 of the National Parks and Wildlife Act 1972Preamble1 The Crown land de
Allan Hancock College - LGARB - 2001419
Passed by both Houses New South WalesLocal Government Amendment(Graffiti Removal) Bill 2001Contents Page
Allan Hancock College - VPB - 2002279
PARLIAMENT OF VICTORIA Volunteer Protection Act 2002 Act No. TABLE OF PROVISIONSClause Page
Allan Hancock College - OLAA - 200859
The legislation that is being viewed is valid for Sessional. Occupational Licensing Amendment Act 2008 (No. 59 of 2008)- CONTENTS Occupational Licensing Amendment Act 2008
Allan Hancock College - VFLB - 2002435
1 Volunteers (Protection from Liability) Bill 2002 Explanatory Memorandum BackgroundAccording to the latest
Allan Hancock College - BACIISAR - 20072
EXPLANATORY STATEMENT Select Legislative Instrument 2007 No. 303 Issued by the authority of the Minister for Employment and Workplace Relations Building and Construction Industry
Virgin Islands - H - 265
HINF 265: Health Care Delivery and Organizational Models Lab Outline - Spring 2009Course Name: Class Times: Class Location: Instructor: Office Hours: Telephone: email: HINF 265 &quot;Health Care Delivery and Organizational Models &quot; Tuesday 9:30-11:30 (Fi
Concordia Canada - CHEM - 221
CHEM 221 section 01 LECTURE #19 Tues., Nov.08, 2005ASSIGNED READINGS:TODAYS CLASS: NEXT LECTURE:continue Ch.5finish Ch.5http:/artsandscience.concordia.ca/facstaff/P-R/rogers(1)Back to thinking about practical things, like isolating compou
East Los Angeles College - DP - 1008
TABLE of CRITICAL VALUES for STUDENT'S t DISTRIBUTIONSColumn headings denote probabilities ( ) above tabulated values. d.f. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 60 80 100 120
Virgin Islands - H - 503
HINF 503 Research Methods in Health Informatics Version 2.0 Summer 2008 Instructor: Dr. Francis Lau Classroom: DSB C130 Class Times: Mon and Wed, 1-4pm Course Description This is a graduate level course to review selected theories and methods used i
Allan Hancock College - INFS - 3101
INFS3101/7100 Ontology and the Semantic WebWeek 12 Suggested Tutorial Solution: Advanced IssuesSemester 1, 2006Consider the rental accommodation exchange from the week 2 tutorial and the representation in the solution to the week 4 tutorial and f
Concordia Canada - CHEM - 221
CHEM 221 section 52 LECTURE #07 TODAYS CLASS:4.6, 4.7 4.8-4.11Thurs., Feb.14, 2008ASSIGNED READINGS:in last days notes actually Alkene reactions with different mechanisms adding RCOOOH: to make epoxide adding HOH/R: oxymercuration, hydroboratio
Concordia Canada - CHEM - 221
CHEM 221 01 LECTURE #09b Tues., Oct. 04/05 2.10 Conformations of Alkanes: rotation about carbon-carbon bondsFor any bond:Overlap of end-on overlapping orbitals is not diminished by rotation about the internuclear axis rotation about a single bond
Allan Hancock College - INFS - 4206
Week 8Lecture 2: Reasoning in Description LogicsReasoning in Description LogicINFS4206/INFS7206School of Information Technology and Electrical EngineeringSemester 2, 2006Reasoning in Description LogicSchool of Information Technology and E
Wofford - COSC - 350
COSC 350: Fall 2008Quiz 3: Chapters 5 &amp; 6Your Name _Be sure to answer each question carefully and completely.A / \ / B / \ D / \ G / \ J K H / L I E / \ C \ F1. (12 pts.) For the tree sketched above, identify or answer each of the following:
Wofford - COSC - 235
COSC 235 Fall 2007 Quiz #3Please read each question carefully and be sure to give complete answers. Good luck! 1. (1 pt.) What is your name? _ 2. (2 pts. each/12 pts. total) Object-oriented Programming Matching Questions: Select the best answer for
Wofford - COSC - 235
COSC 235 Spring 2008: Quiz #3Please read each question carefully and be sure to give complete answers. Good luck! 1. (1 pt.) What is your name? _ (2 pts. each/12 pts. total) Object-oriented Programming Matching Questions: Select the best answer for
Wofford - COSC - 235
COSC235A Spring 2008 Quiz #1Please read each question carefully and be sure to give complete answers. Work quickly and good luck! 1. (1 pt.) Print your name: _ 2. (10 pts.) For each of the follow, indicate whether it is a valid Python identifier or
Wofford - COSC - 235
CS 235 Preliminary Student SurveyThis survey is not meant to invade your privacy. I created it to help me get to know you better. If there is a question that you feel uncomfortable answering, please ignore that question. However, returning the surve
Wofford - COSC - 350
COSC 350: Quiz 3 Chapter 4 &amp; 5Be sure to answer each question carefully and completely.A / \ / B / \ D \ G / J K H / E \ C \ F / \ I1. (10 pts.) For the tree sketched above, identify or answer each of the following: a. root b. leaves c. ancestors
Concordia Canada - CHEM - 426
Chapter 3.Carbenesa) b) c) d) e) f) Definition Structure Stability Generation Reactions Detection64a) Definition Neutral, divalent carbon species Examples: :CH2 :CR2 :C=CH2 CO CN-RPostulated in 1800's: :CCl2 by Geuther (1862) in the hydrolysi
Wofford - COSC - 235
# Lightly edited log from class for February 20th# Aggregate data# Lists&gt; lst = [1, 2, 3]&gt; lst[1, 2, 3]# Indexing&gt; lst[0]1&gt; lst[1]2&gt; lst[2]3# List are mutable (can be changed)&gt; lst[1] = 42&gt; lst[1, 42, 3]# List can hold different typ
Allan Hancock College - MATH - 3306
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;!DOCTYPE html PUBLIC &quot;-/W3C/DTD XHTML 1.0 Transitional/EN&quot; &quot;DTD/xhtml1-transitional.dtd&quot;&gt; &lt;html xmlns=&quot;http:/www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt; &lt;head&gt; &lt;title&gt;Staff Web Page&lt;/title&gt; &lt;meta http-equiv=
Allan Hancock College - COGS - 1000
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;!DOCTYPE html PUBLIC &quot;-/W3C/DTD XHTML 1.0 Transitional/EN&quot; &quot;DTD/xhtml1-transitional.dtd&quot;&gt; &lt;html xmlns=&quot;http:/www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt; &lt;head&gt; &lt;title&gt;Staff Web Page&lt;/title&gt; &lt;meta http-equiv=
Wofford - PSY - 451
GABAergic Influences Increase Ingestion across All Taste Categories Liz Miller Molly McGinnis Lindsey RichardsonA research thesis submitted in partial completion of PSY451 senior research thesis, at Wofford College2 Abstract Each year six million
Allan Hancock College - CHEE - 40218191
THE UNIVERSITY OF QUEENSLANDBachelor of Engineering ThesisThe Rheology of Cystic Fibrosis Sputum Developing a Reproducible tool to assist Diagnosis and TreatmentStudent Name: Course Code: Supervisor: Submission date:LAM HAN HUAT VINCENT CHEE4
Allan Hancock College - CHEE - 40334868
THE UNIVERSITY OF QUEENSLANDBachelor of Engineering ThesisSILICA DERIVED MEMBRANESFOR DEHYDRATION OF AQUEOUS ETHANOLStudent Name: Course Code: Supervisor: Co-Supervisor:CHING WUI CHUA CHEE 4007 Dr Joe Da Costa Dr Mikel DukeSubmission date:
Allan Hancock College - CHEE - 40218285
THE UNIVERSITY OF QUEENSLANDBachelor of Engineering ThesisElectrochemical Storage of Hydrogen Using Carbon NanotubesStudent Name: Course Code: Supervisor:JUSTIN TAN WEE KHIANG CHEE 4006 PROFESSOR MAX LU MR RONG GANG DINGSubmission date: 19th
Allan Hancock College - CHEE - 40163826
THE UNIVERSITY OF QUEENSLANDDEPARTMENT OF CHEMICAL ENGINEERINGBACHELOR OF ENGINEERING (CHEMICAL)Palatable Creamed HoneySupervisor Prof. E. T. White Author Priscilla Chui Ling TaniAcknowledgementsThe completion of this thesis project will n
Allan Hancock College - CHEE - 40334822
THE UNIVERSITY OF QUEENSLANDBachelor of Engineering ThesisInfluence of particle-wall friction and particle size distribution on particle flow and segregationStudent Name: Course Code: Supervisor: Co- Supervisor:Ivan Chee Wei U CHEE 4006 Associ
Allan Hancock College - DDMJVAAB - 2008574
DIAMOND (ARGYLE DIAMOND MINES JOINT VENTURE) AGREEMENT AMENDMENT BILL 2008 EXPLANATORY MEMORANDUMSection 1Contains the short title of the Bill.Section 2 a) Provides for sections 1 and 2 of the Act
Allan Hancock College - IDA - 1963258
INDUSTRIAL DEVELOPMENT ACT 1963Reprinted as in force on 1 January 2009Reprint No. 3A&gt;Contents 1. Short title 2. Dictionary 3. Corporation of the Minister 4. Functions of the corporation 5. Gene
Allan Hancock College - TLACAGB - 2008530
2008The Parliament of theCommonwealth of AustraliaHOUSE OF REPRESENTATIVESPresented and read a first timeTax Laws Amendment (PoliticalContributions and Gifts) Bill 2008No. , 2008(Treasury)A Bill for an Act to amend th
Allan Hancock College - GBEA - 1996509
GOVERNMENT BUSINESS ENTERPRISES (COMPETITION) ACT 1996TABLE OF PROVISIONS PART 1-Preliminary 1. Short title 3. Interpretation 4. Pricing recommendation PART 2-Competition Commissioners 5. Appointment of Commissioners 6.
Allan Hancock College - CCAARAOEOA - 200826
NORTHERN TERRITORY OF AUSTRALIA Criminal Code AMENDMENT (Hit and Run and Other Endangerment offences) ACT 2008 _ Act No. 26 of 2008
Allan Hancock College - GPAB - 2007371
2007 THE LEGISLATIVE ASSEMBLY FOR THE AUSTRALIAN CAPITAL TERRITORY (As presented)
Allan Hancock College - ADAB - 2006264
2004-2005-2006 The Parliament of the Commonwealth of Australia HOUSE OF REPRESENTATIVESPresented and read a first timeAge Discrimination Amendment Bill 2006 No. , 2006(Attorney-General)A Bill for an Act to amend the Age Discrimination Act 200
Allan Hancock College - OHASISAR - 200412004
OCCUPATIONAL HEALTH AND SAFETY (MARITIME INDUSTRY) (NATIONAL STANDARDS) AMENDMENT REGULATIONS 2004 (NO. 1) 2004 NO. 228 OCCUPATIONAL HEALTH AND SAFETY (MARITIME INDUSTRY) (NATIONAL STANDARDS) AMENDMENT REGULATIONS 2004 (NO. 1) 2004 NO. 228 - TABLE
Allan Hancock College - PTAAB - 2004397
Allan Hancock College - INFS - 3100
INFS3100/INFS7909 InformationScienceLecture 6 Controlled VocabularyINFS3100/INFS7909 6 February, 2004R. Colomb, P Eklund1LastLectureFinding sources of information on the internet is called resource discovery. The information structures used
Allan Hancock College - COMP - 3702
Tutorial 12: RoboticsName Student no.For this tutorial, you can work in groups of 1 or 2. Submit the answers to each of the 2 Questions.Question 1Assume you have 100 neural networks and 100 robots. Each neural network is controlling a robot. Th
Allan Hancock College - COMP - 3702
Tutorial 11: Neural networksQuestion 13 inputs, 1 bias, 1 output, logistic (sigmoid) or threshold activation function. Pattern -&gt; Calculation -&gt; Function -&gt; Output 1 -&gt; u = 1*0 + -2*-1 + 2*.5 - .5 = 2.5 -&gt; threshold -&gt; output = 1 2 -&gt; u = 2.5 -&gt; lo
Concordia Canada - COEN - 315
A Tutorial on Using Hspice and Awaves as a Standalone ToolDept. of Electrical and Computer Engineering Concordia University Montreal, Quebec CanadaBy Ted Obuchowicz VLSI/CAD Specialist Concordia UniversityDecember 10, 1997 Revised: January 4, 2
Laurentian - MGT - 4451
Chapter Fourteen Swap Pricing Answers to Problems and Questions 1. If the options are European style you can use the put/call parity model with C P = 0, meaning K = S (1+R)T. Here we have K = 28.55 x (1.055)0.5 = 29.32 If the options are American st
East Los Angeles College - HERT - 1886
Katie Kingwell Exeter College How has Herceptin changed the treatment of breast cancer, and what changes is it likely to effect in the future? Human epidermal growth factor receptor-2 (HER2) belongs to a family of four transmembrane receptor tyrosine
East Los Angeles College - CV - 6505
Environmental Noise Control 2005Coursework (French student cohort)Monitoring of Traffic NoiseIntroduction Noise from transport has become a major pollutant of the outdoor urban environment.The levels of noise cannot be any longer ignored by high
East Los Angeles College - CV - 6505
Environmental Noise ControlLecture 31. To learn about the effects of noise on speech illegibility.Objectives2. To learn about the effects of noise on sleep. 3. To learn about the assessment of noise using the noise rating and noise criterion
East Los Angeles College - CV - 6505
Environmental Noise ControlLecture 41. To learn about the various factors which can affect sound propagation.Objectives2. To learn about the general standard method of calculation of sound propagation outdoors ISO 9613-2. 3. Gain experience i
East Los Angeles College - CV - 6505
Environmental Noise ControlLecture 7Objective1. To learn about the sources of railway noise 2. To learn about the standard UK prediction method Calculation of Railway Noise (CRN).Railway NoiseThere are no regulations to control noise emissi
East Los Angeles College - CV - 6505
Lecture 10: Noise Attenuation Provided by Highway Noise BarriersNoise Attenuation Provided by Highway Noise Barriers Email: K.Horoshenkov@bradford.ac.uk1Presentation Overviewn n n nDefinitions of barrier attenuation Performance of noise barr
East Los Angeles College - NG - 1028
East Los Angeles College - CV - 6505
Environmental Noise ControlLecture 8Objective1. To learn about the Environmental Protection Legislation 2. To learn about the standard UK prediction method Noise Control on Construction and Open Sites (BS 5228).Environmental Law in the UKFo
East Los Angeles College - CV - 6505
Introduction to Environmental Noise Control (ENG3000M)Aims: To gain a knowledge of the basic principles of acoustics and to study the mechanisms of generations, assessment and abatement of various forms of environmental noise. To become familiar wit
Allan Hancock College - CHEE - 4002
CHEE4002 Course ProfilePage 1 of 8CHEE4002: Environmental Risk AssessmentSchool of Engineeringhttp:/www.eng.uq.edu.au 2 Units, Internal, St Lucia Handbook description: Incorporation of the broader issues of sustainability &amp; environmental impact
East Los Angeles College - CV - 6505
Environmental Noise ControlCalculation and Rating of Industrial Noise Affecting a Residential AreaObjectivesThe purpose of the exercise is a) to carry out an assessment of the sound power levels of a metal crushing plant; b) to calculate the LAeq
Allan Hancock College - MATE - 4000
MMME4302: Course Profile BuilderMMME4302: Environmental Performance of Materials 1. Course Details1.1 Summary Course Code MMME4302 Course Title Environmental Performance of Materials School School of EngineeringUnits 2 Campus St Lucia Mode Inter
Allan Hancock College - CHEE - 3003
CHEE3003 Course ProfilePage 1 of 8CHEE3003: Process Engineering Thermodynamicshttp:/www.uq.edu.au/~uqthowes/chee3003/School of Engineeringhttp:/www.eng.uq.edu.au 2 Units, Internal, St Lucia Handbook description: 1st and 2nd laws of thermodyna