BIL108E_mid1_spring09 - BIL108E

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: BIL108E IntroductiontoScientificandEngineeringComputing MidtermExam1 March7,2009 Spring09 1.Evaluatethefunction y = ( ) for ( x + 1)( x + 2) x 2 cos x 3 to using200steps. 2. Writeaprogramtogeneratethefirstntermsinthesequencegivenbythedifference equation xk +1 = 2.25xk - 0.5xk -1 withstartingvalues and .Usen=60.Makeasemilogplotofthevalues youobtainasafunctionofk.Theexactsolutionofthedifferenceequationisgivenby Doesyourgraphbehavecorrespondinglywiththeexactsolution?Showitonthesame graph. 3.Supposeyouhaveacatalogueofautomobilessuchasinthefollowingtable: WriteaMatlabfunctionthatwillinputavectorforID,avectorforColor,avectorfor PriceandreturntheIDnumbersoftheblackcarsthatarepricedunder30000USD. ID 1002 2176 3201 4204 5512 6309 8841 9004 Color 0black 0 1 2 1 2 0 1 0 1blue 2red Price,USD 24000 18000 36000 26000 35000 29000 31000 38000 Duration:75minutes BIL108E IntroductiontoScientificandEngineeringComputing MidtermExam1 March7,2009 Spring09 1. Evaluatethefunction for to instepsof0.01. 2. Writeaprogramtogeneratethefirstntermsinthesequencegivenbythedifference equation xk +1 = 111 - (1130 - 3000 / xk -1 ) / xk withstartingvalues and .Usen=20.Showthattheexactsolutionis amonotonicallyincreasingsequenceconvergingto6. 3. Suppose that you are working in your company's accounting department. Your boss gives you a set of rules and asks you to calculate the salary raise for each employee. Herearetherules: If an employee has fewer than six years of experience and has evaluation that are positiveorhassixormoreyearsofexperienceandtheevaluationsarenotpositive,the employeewillgetan8%raise. If an employee has six or more years of experience and has evaluations that are positive,theemployeewillgeta12%raise. Otherwise,theemployeewillnotgetanyraise. Writeanmfilethatimplementthecompanyrulesandreturnthedesiredpercentraise. Testyournewruleonthedatatable. EmployeeID 1 2 3 4 Yearsofexperience 5 15 3 9 Evaluations 1 0 0 1 Duration:75minutes ...
View Full Document

Ask a homework question - tutors are online