# 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.

3 Pages

### 1995FallExam2

Course: CS 161, Fall 2009
School: Puget Sound
Rating:

Word Count: 510

#### Document Preview

Science Computer 161 C Second Hour Exam Name ______________________ Friday, Oct. 20 100 Pts. I.(5 pts. each) Carefully write down all that would be printed as a result of the following pieces of code: a.for i := 3 downto 1 do for j := 1 to 3 do writeln(i, j); b. i := 0; repeat i := i + 1; writeln(i) until i &gt;= 3 II.(15 pts.)Write the Pascal code (not a...

Register Now

#### Unformatted Document Excerpt

Coursehero >> Washington >> Puget Sound >> CS 161

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.
Science Computer 161 C Second Hour Exam Name ______________________ Friday, Oct. 20 100 Pts. I.(5 pts. each) Carefully write down all that would be printed as a result of the following pieces of code: a.for i := 3 downto 1 do for j := 1 to 3 do writeln(i, j); b. i := 0; repeat i := i + 1; writeln(i) until i >= 3 II.(15 pts.)Write the Pascal code (not a complete program) which will accept a series of positive numbers from the terminal (one line / number) and which will calculate and print the sum of those numbers. We do not know how many numbers will be entered, but the list will be terminated by a negative number. The negative number is not to be added into the sum, but serves simply to end the list of numbers. For example, if we type the numbers 3, 5, 8, 2, 7, -1 (one number per line), the sum should be 25. III.(procedures and functions (15 pts. each) a.Consider the following program: program tryit (input, output); var a, b, c: integer; procedure exam (x: integer; var y: integer); var c: integer; begin{of exam procedure} x := 101; y := 102; c := 103; end;{of exam procedure} begin{of program} ShowText; a := 1; b := 2; c := 3; exam(a, b); writeln(a, b, c) end. i.Clearly identify all global and local variables, formal and actual parameters in the program. ii.What are the values of a, b, and c at the time of the writeln statement (i.e., what will be printed). For each variable, explain (very briefly) why it has that value (i.e., it why was changed or why not). b.(15 pts.)Write a procedure Rotate which will accept three integers (as parameters - not through a readln statement) and which will then replace the second argument with the value of the first argument, the third argument with the value of the second, and the first argument with the value of the third. So, for example, if I have x := 1; y:= 2; z := 3; Rotate(x,y,z); I will end up with x = 3, y = 1, and z = 2. This is a generalization of the Swap procedure. c.(10 pts.)Write a complete function which will accept two real variables as parameters (and again, only as parameters) and which will return the real number which is the square root of the sum of the squares of the two arguments. For example, if I call the function with arguments 3.0 and 4.0, the function should return 5.0. IV.Quickdraw: a.(10 pts.)Write the quickdraw statement to draw the foll...

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:

Brookdale - CS - 6505
%!PS-Adobe-2.0 %Creator: dvipsk 5.521a Copyright 1986, 1993 Radical Eye Software %Title: cheeseman.draft4.dvi %Pages: 23 %PageOrder: Ascend %BoundingBox: 0 0 612 792 %EndComments %DVIPSCommandLine: dvips -o cheeseman.draft4.ps cheeseman.draft4.dvi %D
Duke - CPS - 182
Academic Freedom v. Computer-Security&quot;Somuch has been done, exclaimed the soul of Frankenstein-more, far more,will I achieve; treading in the steps already marked, I will pioneer a new way, explore unknown powers, and unfold to the world the dee
Laurentian - MGT - 3210
Consumer AttitudesAttitudesWhat is an attitude? Expressions of inner feelings that reflect whether a person is favorably or unfavorably predisposed to some object in marketing, &quot;object&quot; can be a brand, a brand name, a service, a service provider
Idaho - ME - 430
Project Management and Laboratory NotebooksLast Updated January 10 2008 Weekly project meetings between project groups and course instructor will be held. Project management will be assisted by maintain a weekly status report and a laboratory notebo
Duke - ENV - 132
&lt;!DOCTYPE html PUBLIC &quot;-/W3C/DTD XHTML 1.0 Strict/EN&quot; &quot;http:/www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;&lt;html xmlns=&quot;http:/www.w3.org/1999/xhtml&quot; lang=&quot;en&quot; xml:lang=&quot;en&quot;&gt;&lt;head&gt; &lt;title&gt;#132: tool_output.txt - Marine Geospatial Ecology Tool
UNC - HR - 133253
Special Invitation from the N.C. Museum of History Free Admission for All State Employees to the Exciting Exhibit Mysteries of the Lost Colony and A New World: England's First View of America from the British Museum Monday, January 14, 2008 9 am-7 pm
UNC - HR - 21008
H.E.E.L.S. for health would like to invite all faculty and staff to the12th annualJingle Bell Jog n l l oThursday, December 5, 20023-MILE FUN RUN MILE WALK1.5Location: Time: Brick courtyard between Fetzer and Woollen Gyms Registr
NORTH CAROLINA DIVISION OF PUBLIC HEALTH PUBLUC HEALTH REGIONAL SURVEILLANCE TEAM (PHRST) REGION 7REGISTRATION FORMSPECIAL NEEDS POPULATION WORKSHOPAPRIL 29, 2009 10:00am 4:00pm Cabarrus Arena and Events Center 4751 highway 49 north Concord, NC
University of Texas - FM - 9001
Job Title: Director of EducationLocation: Missoula, Montana Start Date: January 2007The mission of the Biomimicry Institute is to naturalize biomimicry in the culture by promoting the transfer of ideas, designs, and strategies from biology to susta
Duke - STA - 242
failure temp pressure1 53 2001 57 2001 58 2001 63 2000 66 500 67 500 67 2000 67 2000 68 500 69 500 70 1001 70 501 70 2000 70 2000 72 500 73 1000 75 2001 75 2000 76 2000 76 2000 78 2000 79 2000 81 200
UNC - COMP - 114
114-25.1 COMP 114 Spring 2000 Homework 3: Recursion (B: Chapter 4, S&amp;W Chapter 6) Assigned: Due: February 29, 2000 (leap day!) March 28, 2000 Note! First exam March 7. Closed books, notes, etc. Coverage: everything up to but not including recursion.
UNC - COMP - 524
Function #6: Quality Management (10-27-06) Council CommentsPage 1 of 7QUALITY MANAGEMENT LME FUNCTIONS Council Comments appear in colored or highlighted text 10/27/06 Data Analysis / ReportsConsumer Outcomes: (NC TOPPS / DD COI). DMHDDS
UNC - ECON - 101
Chapter 10Market Power and Monopoly1) SA10 \ \ Price Discrimination and Efficiency\ 1 \ Explain why price discrimination reduces the economic inefficiency associated with the exercise of monopoly power. Draw simple graphs to show how this occurs.
Idaho - CS - 210
1. (25 pts) After each question below answer with the BEST CHOICE of letter or digit from the list of words below. IMPORTANT: NOT ALL LETTERS WILL BE USED. EACH LETTER CAN BE USED ONLY ONCE! Note: this question runs over with a few more on the
UMass Lowell - FACULTY - 141
3.2.34 - When given a formula for a function, it is not sufficient to graph a portion of the function and then claim it is one-to-one on the basis of it passing the horizontal line test. When you are given a graph of a function (as in 3.2.6 and 3
UMass Lowell - FACULTY - 141
4.2.6 - A lot of students didn't complete the entire problem. The problem says to show f(0) = f(2), but then *also* to show that there exists no real number c in (0,2) such that f'(c) = 0. The students who didn't show this fact lost points. If
UMass Lowell - FACULTY - 141
Extra Problem C: It is tempting to say that a non-differentiable functioncannot have an antiderivative defined at its discontinuities. After all,if a function doesn't have a derivative at a certain value of x, how canthe function itself BE a deri
UMass Lowell - FACULTY - 141
For Monday: Read section 1.6. For Wednesday: Read Appendix B, pages 1014. Section 1.5 Main point #3: The Intermediate Value Theorem. Suppose that f is continuous on the closed interval [a,b]. (We define this to mean that f(a) = limxa+ f(x), and f(b)
UMass Lowell - FACULTY - 141
[Go around with names] [Announce new reading assignment for Wednesday: 1.5] [Hand out extra time-sheets] Homework assignments are due at the START of class each Friday Stewart's paraphrase of the definition of limits: We say limxa f(x) = L if the val
Dear Friends, We urgently need your voice NOW! Someone is trying to steal our land, and we need you to write in our support! We normally don't write this kind of emergency letter, but this time it's critical that you know now, pass the word, and resp
UMass Lowell - FACULTY - 475
[Write on board:] Math 475: Introduction to Combinatorics Web-page: www.math.wisc.edu/~propp/475/ Teacher: Jim Propp, 813 Van Vleck (propp@math.wisc.edu) Office hours: TBA I'm Jim Propp. Combinatorics is my favorite branch of mathematics, and I'll be
David Carlson Position Paper for V.P. of Careers Hello fellow Net Impact Members! For those of you who don't know me, I'm a dual-degree student pursuing a Master of Environmental Management with the Nicholas School of the Environment at Duke. Like ma
Center for Sustainable EnterpriseKenan-Flagler Business School October 2003 UpdateNews UNC Kenan-Flagler Leader in Sustainability Education: Last week the Aspen Institute and the World Resources Institute, through its Beyond Grey Pinstripes survey
UNC - COMP - 380
How Computers WorkPart 3 18 February 2008Data TypesComputer doesn't know what the bits represents or what format is being used Computer assumes that the instructions know the format of the data What are the types of data?Numbers, text, p
UMass Lowell - FACULTY - 475
For Tuesday: read section 5.2 HOMEWORK Return assignments # through #3 Collect assignment #4 Arrange coordinates so that (0,0) is at upper left, with the first coordinate (n) indexing rows and the second coordinate (k) indexing columns: (0,0) (1,0) (
UMass Lowell - FACULTY - 141
Periodic functions: We say f has period p (with p&gt;0) if f(x+p)=f(x) for all x. E.g., sin x and cos x have period 2 (and period 4 , and period 6 , etc.). Is every function with period 2 a trig function? .?. No; for instance, let f(x) be the fractional
UMass Lowell - FACULTY - 141
Section 3.4: Exponential growth and decay, concluded Recall: If we have a population in which birth occurs, but not death, and there is no interaction between members of the population, then the size of the population at time t (written as P(t) satis
IREDELL COUNTY JOB DESCRIPTION Job Title: Real Property Manager Department: Tax Administration &amp; Land Records Revised: 2/07 GENERAL STATEMENT OF JOB Under general supervision, performs administrative, supervisory and complex technical work managing t
People who have paid dues Matt Conrec Jeff Coulter Eric Smith (+uniform) Chris Tommerdahl Levon Lee Alec Pearson Sarah Hancox James Ellinger Melissa Henderson Matthew Moye (+uniform) Jessica Anders Heather Wachtler Elisa Mayes Olin Johnson Meredith P
UMass Lowell - FACULTY - 141
A remark about rigor homework and exams: Non-rigorous proofs can get you partial credit, but you'll get MORE partial credit if you show that you recognize that your proof is non-rigorous. (E.g., if you're asked to prove that the derivative of every f
UMass Lowell - FACULTY - 491
Any questions about the homework or the material? The take-home exam (now available on the web) will be due at the start of class next Tuesday (Oct. 28). If you're finding any of the material difficult, now is the time to see me and get help. If you
UMass Lowell - FACULTY - 491
I've looked over the homeworks, and it seems like a large part of the problem is that you sometimes don't know what I'm asking you for. Please don't be shy about sending me email if you feel like you may be missing the point of a question (e.g., if i
UMass Lowell - FACULTY - 491
Office hours: Tuesdays from 2:15 to 2:45 p.m. (in B107 until further notice) Thursdays from 12:15 to 12:45 p.m. (in 813 Van Vleck) Theorem: If f(0) = 0, then 1/(1-f) = 1 + f + f^2 + f^3 + . Proof: Let g = 1 + f + f^2 + f^3 + . (check that this is wel
UMass Lowell - FACULTY - 475
For Thursday: read 8.3 Section 8.2: Stirling numbers Fix a non-negative integer p. One basis for the space of polynomials of degree p is the &quot;monomial basis&quot; {n^0, n^1, n^2, ., n^p}; another basis is {(n choose 0), (n choose 1), ., (n choose p)}; an
UMass Lowell - FACULTY - 491
Any questions about the homework or the material? TODAY: The strip-tiling theorem Weighted enumeration Domino tilings of the 2-by-n rectangle (again) Use cell-labels L, R, T, B Give example of a tiling of a 2-by-5 with labeled cells Frontiers: LL, LR
UMass Lowell - FACULTY - 491
TODAY: Non-commuting variables The sign of a permutation Permanents and determinants Lindstrom's lemma Non-commuting variables Stephen showed you a q-binomial theorem; here's one I like better. Suppose x,y are non-commuting variables satisfying yx=qx
UMass Lowell - FACULTY - 475
OFFICE HOURS: Tuesdays and Thursdays, 10:50-11:50 in Van Vleck 813 (10:55-11:55 isn't working for me), plus the caf hours (as announced before; see the web page) Also by appointment. Come to my office and cafe hours. (I'll say this again.) READING Fo
UMass Lowell - FACULTY - 142
[Write on board:] James Propp Office: OH 428C Phone: 978-934-2438 Email: jpropp@cs.uml.ignorethispart.edu Course web-page: faculty.uml.edu/jpropp/142 Welcome to Math 142! Honors calculus is the first math course I took in college and the first course
UMass Lowell - FACULTY - 142
The &quot;Get at automatic A in my course if you can solve this&quot; problem: Find two differentiable functions f, g such that the functions f g and fg do not have antiderivatives. Solution by Prof. Kheifets: Take {x2 sin 1/x4 { {0 {x2 cos 1/x4 { {0 if x 0
UMass Lowell - FACULTY - 141
Section 4.1, concluded How do we find global maxima and minima for a function on a closed interval? We look at endpoints and local maxima and minima. How do we find local maxima and minima? We look at all the critical points. Definition: A critical n
UMass Lowell - FACULTY - 475
[Return assignments #1 through #4 Collect assignment #5] Exam format: Closed book, closed notebook, no calculators. How many sequences of length ten, consisting of 0's and 1's, add up to six? . 10 choose 6. Interpret via sets and multisets: . 6-combi
UMass Lowell - FACULTY - 475
Office/cafe hours: Tuesdays _and_ Thursdays, 10:50-11:50 in Van Vleck 813 Tuesdays, 2:45-4:00 at the State Street Steep and Brew Wednesdays, 1:30-3:30 at the State Street Steep and Brew READING For next Tuesday: read second section of Chapter 3 For n
University of Illinois, Urbana Champaign - SHELLEY - 301
FARS Assignment (also Jennings, Chapter 1)CF1-6. List five different categories of potential users of financial statements. (Group 3) CF1-6. Investors, creditors, employees, suppliers, customers, regulators. CF1-7. Who did the FASB decide to focus
University of Illinois, Urbana Champaign - SHELLEY - 301
InClass Concept Mapping Assignment Definition: &quot;Concept maps are tools for organizing and representing knowledge. The include concepts, usually enclosed in circles or boxes of some type, and relationships between concepts or propositions, indicat
Idaho - WEBPAGES - 507
Completely Randomized Factorial Design With Two FactorsAssumptions: In addition to the assumptions that we already talked about this design assumes: 1) Two or more factors, each factor having two or more levels. 1) All levels of each factor are inve
Idaho - WEBPAGES - 507
Completely Randomized Factorial Design With Two Factors ExampleA police department in a big city want to assess their human relations course for new officers. The independent variables are the type of neighborhood the officers get to be assigned to
Idaho - WEBPAGES - 507
Analysis of Variance Designs I. Systematic Designs II. Randomized designs with one treatment a. Experimental units not subdivided on any bases other than randomization prior to assignment to treatment levels; no restriction on random assignment other
Idaho - WEBPAGES - 507
HW2STAT50707 Exercise 5.2: Answer all parts in addition to the following part d: d) Use REGWR procedure to control for the strong familywise error rate; SNK to control for FDR; protected LSD to control for the familywise error rate; and LSD to contr
Idaho - WEBPAGES - 507
Exercise 10.2 Problem 10.3 Exercise 11.2 Problem 11.2 Follow the steps: 1) Write down the linear model. 2) Identify the hypotheses you want to test. 3) Evaluate the error term and see if you need to perform any transformations 4) If you need any tr
Idaho - WEBPAGES - 301
# Normal graphlambda &lt;- 5x &lt;- seq(0,3, by = 0.1)f.x &lt;- lambda*exp(-x*lambda)plot(x,f.x,type=&quot;l&quot;,xlab = &quot;x&quot;, ylab = &quot;f(x)&quot;)abline(v=1/lambda)
Idaho - WEBPAGES - 301
games &lt;- 1000000win &lt;- 0for(i in 1:games){ if(runif(1)&gt;(5/6){ win &lt;- win + 6 - 1 }else{ win &lt;- win - 1 }}win/games
Idaho - WEBPAGES - 301
x &lt;- 1for(i in 0:69){ x &lt;- x * (365-i)/365}
Idaho - WEBPAGES - 451
# datax &lt;- seq(0.01, 20, by=0.01)# gamma pdf GAM(x;th,k)th &lt;- 2k &lt;- 2y &lt;- (1/(th^k)*gamma(k)*x^(k-1)*exp(-x/th)plot(x,y, type=&quot;l&quot;)# exponential pdf EXP(x; th)th &lt;- 2y &lt;- (1/th)*exp(-x/th)plot(x,y, type=&quot;l&quot;)# Weibull pdf WEI(x; th, bt
Idaho - WEBPAGES - 452
mu &lt;- seq(0,10,by=0.01)T.2 &lt;- exp(-mu)*(exp(mu/exp(2)-2*exp(-mu*(1-1/exp(1)+exp(-mu)T.1 &lt;- exp(-mu)*(1-exp(-mu)#plotting the Risk for plot(mu,T.1,ylab=&quot;T1 (dots) and T2 (line)&quot;,xlab=&quot;mu&quot;)lines(mu,T.2,type=&quot;l&quot;)#finding the maximum for T2T2.mu
Idaho - WEBPAGES - 301
# Negative binomial light bulb examplex &lt;- 0:100r &lt;- 3p &lt;- 0.1y &lt;- choose(x+r-1,r-1)*(p^r)*(1-p)^xy.cdf &lt;- cumsum(y)#pmfplot(x,y,xlab=&quot;x&quot;,ylab=&quot;P(X=x)&quot;,type=&quot;h&quot;)#CDFplot(x,y.cdf,xlab=&quot;x&quot;,ylab=&quot;P&lt;=x)&quot;,type=&quot;S&quot;)#pmf using line graphsplot(
Idaho - WEBPAGES - 301
# Normal graphmu &lt;- 70sigma &lt;- 2.5x &lt;- seq(mu-4*sigma,mu+4*sigma, by = 0.1)f.x &lt;- (1/sqrt(2*pi*sigma^2)*exp(-(x-mu)^2/(2*sigma^2)plot(x,f.x,type=&quot;l&quot;,xlab = &quot;x&quot;, ylab = &quot;f(x)&quot;,xlim=c(30,110)abline(v=mu)text(mu,0.01,labels=&quot;mu=70&quot;,pos=3)ablin
Duke - STA - 242
&quot;species&quot;&quot;bodymass&quot;&quot;maxdist&quot;&quot;type&quot;&quot;Didelphis virginianus&quot;2.41455.152&quot;O&quot;&quot;Phascogale tapotafa&quot;0.1726.8&quot;C&quot;&quot;Trichosurus vulpecula&quot;2.9312.8&quot;C&quot;&quot;Sorex araneus&quot;0.0040.869&quot;C&quot;&quot;Scapanus townsendii&quot;0.1480.856&quot;O&quot;&quot;Ursus americanus&quot;104.452
UMass Lowell - FACULTY - 475
For Thursday: read section 6.2 (we'll pick up with section 6.3 after the midterm) Review chapters 1, 2, 3, and 5 and bring in questions on Thursday. If you have any requests that might require advance preparation on my part, send me email later today
UMass Lowell - FACULTY - 141