Starting from:

$15.99

Scheme Interpreter_Lab 0 solution

Try This! PracticeyournewlydevelopedSchemepowerswiththefollowingexpressions: 1. UsetheSchemeinterpretertocomputetheproduct34,234,567×23,123,456. 2. UsetheSchemeinterpretertocompute45,321,1233.
Lab Assignment Activities
1. CurrencyConversion (a) The exchange rate between U.S. dollars and euros is 1$ = 0.93 €. Write a Scheme procedure to convert dollarsintoeuros. Howmanyeuroswillyougetwhenyouexchange$50? (b) TheexchangeratebetweeneurosandJapaneseyenis1€=121/73¥. WriteaSchemeproceduretoconvert eurosintoyen. Howmanyyenwillyougetwhenyouexchange€50? (c) Write a procedure using your solutions from parts (a) and (b) to convert U.S. dollars to yen. How many yencanyoureceiveinexchangefor$50? 2. A matrix is a rectangular grid of numbers organized into rows and columns. Matrices are an important tool in algebraandareoftenusedtosolvesystemsoflinearequations. Belowareexamplesofacoupleof2×2matrices (matriceswith2rowsand2columns)thatwewillcall M andN. M =2 −4 −6 12‹ N =−3 1 2 7‹ (a) A special value associated with any 2×2 matrix is the determinant. Given a generic 2×2 matrix, the determinantcanbecomputedusingthefollowingformula: deta b c d‹=ad−bc Usingtheformula,wecancomputethedeterminantofmatrix M aboveas(2)(12)−(−4)(−6)=0. Writea Schemeproceduretocomputethedeterminantofageneric2×2matrix. Assumethatthematrixelements a. b, c and d aregivenasfourformalparameters. ComputethedeterminantofN. (b) Amatrixiscalledinvertible ifitsdeterminantisnon-zero. Writeaprocedurethatcheckswhetherornota generic2×2matrixisinvertible. VerifythatN isinvertibleand M isnotinvertible. (c) Thedeterminantofa3×3matrixcanbecomputedfromthefollowingformula: det  a b c d e f g h i =a×dete f h i‹−b×detd f g i‹+c×detd e g h‹ Fillinthebodyofthefollowingproceduretofindthedeterminantofa3×3matrix: (define (det3x3 a b c d e f g h i)
; your code here
) Whatisthedeterminantof0 5 −6 8 −11 4 5 1 1?
3

More products