Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(eproblem 2) Given the definitions below (LO, HI, and foo), write the step-by-step evaluation of this expression: (foo (2 + 16 15))) Be sure to
(eproblem 2) Given the definitions below (LO, HI, and foo), write the step-by-step evaluation of this expression: (foo (2 + 16 15))) Be sure to show every intermediate evaluation step, including the original expression and the final result. Your steps must not be commented out. (define LO 50) (define HI 100) (define (foo x) (if x Lo) "too low" (if (> x HI) "too high" (string-append "all good:"(number->string x)))) pset-01-starter.rkt- DrRacket File Edit View Language Racket Insert Iabs Help pset-01-starter.rkr (define ) (eproblem 3) Ali has written code including a function to make rectangles of their favorite color. But there is one mistake in the code that you need to fix First uncomment the code below, and then fix the mistake. Note that there is only one mistake and your fix should preserve the functionality that Ali has worked hard on. : (define COLOR "purple") : (define (pretty-rect w h) :(rectangle w h "solid" CoLOR)) (pretty-rect 20 30 "purple") pset-01-starter.rkt DrRacket File Edit View Language Ragket Insert Iabs Help pset-01-starter.rkr Syntaxe. StepH Run (define ) (pretty-rect 20 30 "purple") (@problem 4) Design a function called order that consumes two integers and produces a message saying what order they come in. For example: (order 5 3) should produce "3 then 5" (order 2 6) should produce "2 then 6" You will want to use the number->string primitive. Your design must follow all applicable recipes,and must include all appropriate etags. Solutions which "just work" but do not follow the design recipes will receive few if any marks :(@htdf order) Uncomment this line when you start the problem. (eproblem 2) Given the definitions below (LO, HI, and foo), write the step-by-step evaluation of this expression: (foo (2 + 16 15))) Be sure to show every intermediate evaluation step, including the original expression and the final result. Your steps must not be commented out. (define LO 50) (define HI 100) (define (foo x) (if x Lo) "too low" (if (> x HI) "too high" (string-append "all good:"(number->string x)))) pset-01-starter.rkt- DrRacket File Edit View Language Racket Insert Iabs Help pset-01-starter.rkr (define ) (eproblem 3) Ali has written code including a function to make rectangles of their favorite color. But there is one mistake in the code that you need to fix First uncomment the code below, and then fix the mistake. Note that there is only one mistake and your fix should preserve the functionality that Ali has worked hard on. : (define COLOR "purple") : (define (pretty-rect w h) :(rectangle w h "solid" CoLOR)) (pretty-rect 20 30 "purple") pset-01-starter.rkt DrRacket File Edit View Language Ragket Insert Iabs Help pset-01-starter.rkr Syntaxe. StepH Run (define ) (pretty-rect 20 30 "purple") (@problem 4) Design a function called order that consumes two integers and produces a message saying what order they come in. For example: (order 5 3) should produce "3 then 5" (order 2 6) should produce "2 then 6" You will want to use the number->string primitive. Your design must follow all applicable recipes,and must include all appropriate etags. Solutions which "just work" but do not follow the design recipes will receive few if any marks :(@htdf order) Uncomment this line when you start the
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started