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

4 Pages

### CS1371_PracticeTest1

Course: CS 1371, Summer 2010
School: Georgia Tech
Rating:

Word Count: 659

#### Document Preview

Computing CS1371 for Engineers Practice Test 1 Spring 2010 Georgia Institute of Technology College of Computing CS1371 Computing for Engineers Practice Test 1 Spring Semester 2010 Problem Solving Matthew spends 25% of his 4-hour summer camp time receiving swimming instruction. If Matthew goes to camp for 15 weeks and goes to camp only on weekdays, how many hours does Matthew spend *NOT* receiving swimming...

Register Now

#### Unformatted Document Excerpt

Coursehero >> Georgia >> Georgia Tech >> CS 1371

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.
Computing CS1371 for Engineers Practice Test 1 Spring 2010 Georgia Institute of Technology College of Computing CS1371 Computing for Engineers Practice Test 1 Spring Semester 2010 Problem Solving Matthew spends 25% of his 4-hour summer camp time receiving swimming instruction. If Matthew goes to camp for 15 weeks and goes to camp only on weekdays, how many hours does Matthew spend *NOT* receiving swimming instruction? You do not have to calculate the answer, but rather write one or two lines of MATLAB code that will solve this for you. Functions 1. Which one of the following statements is *false* about function headers? A. An equal sign (=) is only required if there is output B. Multiple inputs must be separated by commas C. Multiple outputs must be in parenthesis and multiple inputs must be in square brackets D. The function must have a name E. Outputs are not required 2. Which one of the following statements is *false* about functions in MATLAB? A. Functions must be saved in a file that is named the same as the function name. B. Functions can access variables defined in the MATLAB workspace. C. Functions have local scope; i.e. they have their own workspace. D. Functions can have zero or more outputs. E. MATLAB built-in functions can be called from functions that you write. Coding 1. Given a variable, arr, which is an nxn array, write script that will swap the even and odd rows. Page 1 of 4 CS1371 Computing for Engineers Practice Test 1 Spring 2010 Coding continued 2. Given a vector, vec, write a script which counts how many perfect squares are in the vector. Store the answer in a variable named count. A perfect square is a number whose square root is an integer. (Hint: mod(x,1)==0 will return true if x is an integer.) 3. Write a function for the problem described below: Function Name: strShift Inputs (2): - a string (character array) containing a string of letters and spaces - a scalar double containing the number of characters to shift the string by Outputs (1) a string (character array) containing the string of letters and spaces shifted as described by the function description. Function Description: The function strShift takes in 2 inputs, a string containing only letters and spaces, and a scalar double for a shift value. The function should shift only the characters (not the spaces) by the specified shift amount. The spaces should remain in place. their This shifted string is the only output to the function. Note: The shift value will always be > 0. str1 str1 str2 str2 str3 str3 = strShift(Practice, 3) => icePract = strShift(Hello world, 2) => ldHel lowor = strShift(One Last Test Case, 1) => eOn eLas tTes tCas Page 2 of 4 CS1371 Computing for Engineers Practice Test 1 Spring 2010 Tracing 1. Read the code below and answer the questions that follow: a = [1 -2 5 6 -4 0] a(4) = []; a(4) = a(4) + 10; a((a<=0)) = 100 b = a(mod(a,2)==0); c = sum(a)/[length(a)-4]; d = a; What are the final values of the following variables after the code above is executed in MATLAB? b = ____________________________________________________________________ c = ____________________________________________________________________ d = ____________________________________________________________________ 2. The following commands are executed in MATLAB: vec1 vec2 vec3 vec4 vec5 vec6 = = = = = = [7 8 9 2 0 8 1 2 3]; prod(vec1) zeros(1, 4) + vec1(2:2:end) 2; vec1~=vec4 find((vec1) == 8) What is the final value of vec2? A. 48384 B. 0 C. 40 D. 7 E. None of the above What is the final value of vec3? A. [8 9 2 0] B. [0 0 0 0] D. [7 9 0 1] C. [8 2 8 2] E. Error What is the final value of vec5? A. [7 8 9 0 8 1 3] B. [0 0 0 1 0 0 0 1 0] D. [1 1 1 0 1 1 1 0 1] C. 0 E. None of the above What is the final value of vec6? A. [8 8] B. [0 1 0 0 0 1 0 0 0] C. [2 6] Page 3 of 4 D. 2 E. Error CS1371 Computing for Engineers Practice Test 1 Spring 2010 Tracing continued function A = checkMe(P, Q, R, S) if (P & (( Q & R) | S)) A = 1; elseif ~P & (( Q & R ) | S) A = 2; elseif (~Q & P) & ( ~R ) A = 3; elseif ~Q & (P & R) A = 4; else A = 5; end What are the values of output in the following function calls? output = checkMe(true, true, true, true): __________________________________________________________________ output = checkMe(false, false, false, false): __________________________________________________________________ output = checkMe(true, false, false, false): __________________________________________________________________ output = checkMe(true, false, false, true): __________________________________________________________________ output = checkMe(true, false, true, false): __________________________________________________________________ Page 4 of 4
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:

Georgia Tech - CS - 1371
CS1371 Computing for Engineers Practice Test 1Spring 2010Georgia Institute of TechnologyCollege of ComputingCS1371 Computing for EngineersPractice Test 1 Spring Semester 2010Problem SolvingMatthew spends 25% of his 4-hour summer camp time receiving
Washington State - COMM - 409
Washington State - COMST - 475
Syracuse - ECS - 222
MAE251 Test 1 Spring 2009Closed book time: 50 min grading: 10+101. A piston-cylinder device initially contains steam at 120 oC, 150 kPa and 0.5 m3.At this state, a linear spring is touching the piston but exerts no force on it. Heat isslowly transferr
USC - EE - 441
EE avlHU](,169ol *twns/ogu 1 - r o/ . 4 .|^V(o,b)Ro^ Pr.*weivr- r?lL W JL ]Col/xry P &gt;otute-Il = 3 &quot; [ nk*^ l J + r xfc6lru=t161?llJ34*+tl1w+)=/44+ W+ Z4 y ' +w = )=)wzV=2,2=2,1'L+w=27efiIhp. zn +a/ se,ct&gt;or1 zS cL Line* ,e. f owrth
USC - CE502 - 502
USC - CE502 - 502
USC - CE502 - 502
USC - CE502 - 502
USC - CE502 - 502
USC - CE502 - 502
USC - ISE - 561
USC - ISE - 561
1/31Linear ProgrammingFrequently Asked QuestionsOptimization Technology Center ofNorthwestern University and Argonne National LaboratoryPosted at http:/www-unix.mcs.anl.gov/otc/Guide/faq/linear-programming-faq.htmlChanges posted to Usenet newsgroup
USC - ISE - 561
ISE 561 Spring 2012 MidtermMarch 06, 2011Start (clock time)_ Date_Stop (clock time)_Name (Print) _SCORE (Out of 120)_MIDTERM EXAM (2 hours)1.This is an open book exam. You may use your textbook and 2 pages of notes, but no other references areper
USC - ACCT - 410
USC - ACCT - 410
AccountingQuiz#31. Jobordercostingandprocesscostingaretwobasictypesofcostaccountingsystemswhichmeasure,record,andreportproductscostssothatcompaniescandeterminewhichproductstoproduceandwhattocharge.Jobordercostingassignscoststoeachjoboreachbatchofprodu
USC - MATH - 118x
Math 118Quiz 6April 5, 2012Solutions2x2 + x 5dx = x 2 + 2 x1/ 2 5 ln xx1. (3) A = 2x2 + x 55dx = ( 2 x + x 1/ 2 ) dxxx21/ 221/ 2= 2 x / 2 + 2 x 5 ln x = x + 2 x 5 ln xIndef. Int. A = 2. (3) B = 03x3x2 + 1dx = 4 / 3Use Substitution
USC - MATH - 118x
Math 118Midterm 2March 28, 2012(Most problems are from previous finals)1.(15)Let y = ( x )(1+ x ) , find. You can leave you answers in terms of x and y.1ln y = ln( x )(1+ x ) = (1 + x ) ln x = (1 + x ) ln( x )1/ 2 = (1 + x ) ln x2Diff both side
USC - MATH - 118x
Math 118 Homework 2 Solutions March 27, 20121. (20) Let the functionbe defined on the intervala) The x-coordinate(s) of the absolute max ofon.b) The x-coordinate(s) of the absolute min ofonUse Recipe for Abs max and min on closed interval.. Find:
USC - MATH - 118x
Math 118Homework 1SolutionsFebruary 14, 20121. Evaluate the following limits. If the limit is infinite, indicate +If the limit does not exist write DNEx3 + 2x 3lim= 1/ 2a)x 2 x 3 + x 2 2or -.x3 + 2x 3x3= 1/ 2For x large,2x3 + x2 2 2x3b)
USC - MATH - 118x
Math 118Take-Home Quiz 51. (3) Let.2. (3) FindMarch 8, 2012 SolutionsSolve for x., for x &gt; 0.You can leave your answer in terms of x and y.Use log diff. Take logs of both sides:x e2 xln y = ln= ln x + ln e2 x ln( x + 5)44( x + 5)ln y = (1 /
USC - MATH - 118x
Math 118Quiz 4Solutions1. (4) LetMarch 1, 2012be defined on the interval I:. Find-coordinate(s) of the abs max and min.Use Recipe for Abs Max and Min on Closed Interval.Step 1. Calculate critical numbers: Critical Numbers are x = 0 and x = -1.S
USC - MATH - 118x
Math 118Midterm 1SolutionsFebruary 15, 20121. (15) Evaluate the following limits. If the limit is infinite, indicate or .If the limit does not exist write DNE.xxxa) For large x,Ans. = 1/2 1/ 24x2 14x2 2xx2 x 2b) limx 1x32x2 x 2 12x2 x
USC - MATH - 118x
Math 118Quiz 3 SolutionsFebruary 2, 20121. (3) A projectile is launched vertically upward from ground level with initial velocity of 160 ft/sec.What is the velocity when the projectile hits the ground. Justify your answer.Ans. Velocity at impact = -1
USC - MATH - 118x
Math 118Quiz 2SolutionsJanuary 26, 20121. (3) Evaluate2. (3) Find the value of constantthat makes the functioncontinuous at, whereFind both one-sided limits at3. (4) Letb) Eq. Tan line at x = 2:. Use the definition of the derivative to calcula
USC - MATH - 118x
Math 118Quiz 1 - Solutions1. (2) LetCalculate the composite functionJanuary 19, 2012.and evaluatea)b)2. (2) Determine equation of the line L2 that goes through the point (-1/2, 1) and is perpendicular to the line L1: 2 x + 5 y = 3.Find the slope
USC - MATH - 118x
Math 118Quiz 6April 5, 2012(20 minutes)1/2Print Name_Signature_Student ID Number _1. (3) Evaluate A = 2x2 + x 5dxx2. (3) Evaluate B = 03x3x2 + 1dxe213. (3) Evaluate C = dxe x(ln x )2=_B = _C = _Write your answers in the spaces abo
USC - MATH - 118x
Math 118Midterm 2 (Make-Up)Time: 1 hr +15 minName (Print)March 28, 2012_Name (Signature) _Student ID Number _Show work. Use back side of previous page if needed.Write your answers in the appropriate places.You can leave answers in the form of fr
USC - MATH - 118x
Math 118Quiz 5March 8, 2012 (20 minutes)1/2PrintName_Signature_Student ID Number _Write your answers in the designated places. Show work below and on the next page as necessary.Use back side of paper if needed. You can leave answers in terms of exp
USC - MATH - 118x
Math 118-Homework 2Name (Print)Due Tues. March 27, 2012 (At beginning of your Discussion Section)_Name (Signature) _Student ID Number _INSTRUCTIONS: For all problems, write your answers in the indicated spaces and show your workbelow or on back of
USC - MATH - 118x
Math 118Midterm 1 (Part 1) February 15, 2012( Problems 1, 2, 3)Time: 1 hrName (Print)_Name (Signature) _Student ID Number _Show work. Use back side of previous page if needed.Write your answers in the appropriate places.You can leave answers in
USC - MATH - 118x
Math 118-Homework 1Name (Print)Due Tues. Feb 14, 2012 (At beginning of your Discussion Section)_Name (Signature) _Student ID Number _INSTRUCTIONS: For all problems, write your answers in the indicated spaces and show your workbelow or on back of pr