Using Dr. Racket to compute the following expressions. [5 points] (1) 3+5-7 (2) 2* (8+5+4) -...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Using Dr. Racket to compute the following expressions. [5 points] (1) 3+5-7 (2) 2* (8+5+4) - 25 (3) 10 ((35)+(2+ (0*5))) (4) 5* (4+ ((( 10+10) + (5*8))/(10+2))) (5) ((((((3+5)*(6+4))/2)/2)-5)/3)+((((2 * 10)+(5*4))/2) + (4*5)) 2. Bind (define) each value in 1.5 above to its' English text and then change the expression using the defined names. [5 points] For example, the values in 1.1 should be replaced with names three, five, and seven, and the correct corresponding expression is (eight + two - ten). 3. Define a procedure "Subtract" that takes parameters and returns the difference of them You can use the built-in "-" to define your Subtract procedure. [5 points] 4. Define a recursive procedure called "IntDivide" that will compute the quotient of x divided by y. You must implement IntDivide procedure by a sequence of Subtract procedures. (1) You must use the Subtract procedure defined above. (2) You will need to account for negative values as well. Hint: This will require a conditional and possibly the (abs x) procedure. You may not use the built-in division or quotient operators in this procedure definition. [10 points] 5. Define a procedure "ReadForintDivide" to read the two input values for the IntDivide procedure defined in the previous. This procedure takes no parameters and will pass an input value to the Square procedure. [5 points] 6. Define a recursive procedure called "Multiply" that will compute the product of x times y. You must implement Multiply procedure by a sequence of additions. [5 points] (1) You can use the built-in + operation. (2) You will need to account for negative values as well. 7. Define a procedure (DiffDivide x y) that will compute the following expression: x - (x/y)*y. For example, if x = 8 and y = 3, then, 8 - (8/3)*3 = 2 You must use Subtract, IntDivide, and Multiply defined in the previous questions. [5 points] 8. Re-implement the procedure (DiffDivide x y) and call it (DiffDivide Let x y). In this procedure, you must use let-form to bind all the procedures used in the definition: Subtract, IntDivide, and Multiply. You may name the local name whatever you'd like. [10 points] Using Dr. Racket to compute the following expressions. [5 points] (1) 3+5-7 (2) 2* (8+5+4) - 25 (3) 10 ((35)+(2+ (0*5))) (4) 5* (4+ ((( 10+10) + (5*8))/(10+2))) (5) ((((((3+5)*(6+4))/2)/2)-5)/3)+((((2 * 10)+(5*4))/2) + (4*5)) 2. Bind (define) each value in 1.5 above to its' English text and then change the expression using the defined names. [5 points] For example, the values in 1.1 should be replaced with names three, five, and seven, and the correct corresponding expression is (eight + two - ten). 3. Define a procedure "Subtract" that takes parameters and returns the difference of them You can use the built-in "-" to define your Subtract procedure. [5 points] 4. Define a recursive procedure called "IntDivide" that will compute the quotient of x divided by y. You must implement IntDivide procedure by a sequence of Subtract procedures. (1) You must use the Subtract procedure defined above. (2) You will need to account for negative values as well. Hint: This will require a conditional and possibly the (abs x) procedure. You may not use the built-in division or quotient operators in this procedure definition. [10 points] 5. Define a procedure "ReadForintDivide" to read the two input values for the IntDivide procedure defined in the previous. This procedure takes no parameters and will pass an input value to the Square procedure. [5 points] 6. Define a recursive procedure called "Multiply" that will compute the product of x times y. You must implement Multiply procedure by a sequence of additions. [5 points] (1) You can use the built-in + operation. (2) You will need to account for negative values as well. 7. Define a procedure (DiffDivide x y) that will compute the following expression: x - (x/y)*y. For example, if x = 8 and y = 3, then, 8 - (8/3)*3 = 2 You must use Subtract, IntDivide, and Multiply defined in the previous questions. [5 points] 8. Re-implement the procedure (DiffDivide x y) and call it (DiffDivide Let x y). In this procedure, you must use let-form to bind all the procedures used in the definition: Subtract, IntDivide, and Multiply. You may name the local name whatever you'd like. [10 points]
Expert Answer:
Related Book For
Probability And Statistics For Engineering And The Sciences
ISBN: 9781305251809
9th Edition
Authors: Jay L. Devore
Posted Date:
Students also viewed these accounting questions
-
The manager of Pierce Furniture needs to compute the following amounts. a. Total cash paid during October. b. Cash collections from customers during October. Analyze Accounts Receivable. c. Cash paid...
-
The manager of Dubois Furniture needs to compute the following amounts. a. Total cash paid during March. b. Cash collections from customers during March. Analyze Accounts Receivable. c. Cash paid on...
-
The expectation. Use integration by parts to compute the following statistics for an exponentially distributed random variable with parameter .
-
On December 1, 2018, BEEN RICHARDS Company entered into two independent forward contracts to sell US$1,200 in 90 days or on March 1, 2019. The exchange rates available on various dates are as...
-
The U.S. Census Bureau publishes data on factory orders for all manufacturing, durable goods, and nondurable goods industries. Shown here are factory orders in the United States from 1987 through...
-
In Exercises 49-52, sketch a plane. Then sketch the described situation. Three noncollinear points that lie in the plane
-
BlackBerry Ltd. has a target current ratio of 2.0 but has experienced some difficulties financing its expanding sales in the past few months. At present, the firm has current assets of $750,000 and a...
-
Kurtz Fencing Inc. uses a job order cost system. The following data summarize the operations related to production for March, the first month of operations: A. Materials purchased on account,...
-
which a disk A of radius r rotates about a fixed vertical axis with angular displacement q1. A bar B of length h is pinned to A such that the axis of rotation is a radial line of A. (Note this is a...
-
The members of the Vistas Club are planning a month long hiking and camping trip through the Blue Ridge Mountains, from north Georgia to Virginia. There are a number of trails through the mountains...
-
After several profitable years running her business, Izzy decided to acquire the assets of a small competing business. On June 1 of year 1, Izzy acquired the competing business for $308,300. Izy...
-
What is continuous audit? In which case is this audit applicable? State the advantages and disadvantages of continuous audit.
-
State what information you would require and what documentary evidence you would see while vouching the following (a) Freight, Carriage and Custom duty. (b) Commission paid to sole-selling agent. (c)...
-
What are special and general qualifications that an auditor should possess and why?
-
Discuss the advantages of audit (a) to the management (b) to the Government (c) to the shareholders and (d) to the society.
-
How is the auditor of a government company appointed?
-
A student survey asked "What is the length of your forearm (in inches)?". Here is the data (in inches): 14, 16, 16, 12, 16, 10, 10, 10, 8 What is the mean length (in inches)? (Round your answer to 2...
-
Refrigerant-134a enters an adiabatic compressor as saturated vapor at 120 kPa at a rate of 0.3 m3/min and exits at 1-MPa pressure. If the isentropic efficiency of the compressor is 80 percent,...
-
Of n1 randomly selected male smokers, X1 smoked filter cigarettes, whereas of n2 randomly selected female smokers, X2 smoked filter cigarettes. Let p1 and p2 denote the probabilities that a randomly...
-
Construct a control chart for the data of Exercise 25 by using the transformation suggested in the text. Exercise 25 The accompanying observations are numbers of defects in 25 1-square-yard specimens...
-
A random sample of smokers was obtained, and each individual was classified both with respect to gender and with respect to the age at which he/she first started smoking. The data in the accompanying...
-
Sustainability involves more than just the impact of actions on the environment. The triple bottom line recognizes that a company has to measure its impact on its triple bottom line for its long-term...
-
Bryan Haas has his own electronics retail chain, TechnoGeek. His stores sell computer parts, audiovisual equipment, consumer electronics, and related items. Custom computer building and electronics...
-
Shula Perot is the new controller for EduTechno Software, which develops and sells educational software. Shortly before the December 31 fiscal year-end, Nico Cattrall, the company president, asks...
Study smarter with the SolutionInn App