subject

1. Define a procedure (Divide x y) that takes two parameters x and y and returns the division result x/y. Then, call your procedure using Test case:
> (Divide 10 3)
3 1/3
2. Define a recursive procedure called (nDivide x y n) with three parameters x, y and n. It returns the result of x divided by y n times: x/y/y/.../y. Instead of using "[", you must use the Divide function that you developed in the previous question.
Test case:
> (nDivide 10 3 4)
10/81
3. Define a procedure (Dividen Divide u vxy n) that will computes the division result of two nDivide procedures: (n Divide u v n) and (nDivide x y n). You must call Divide procedure and procedure that you have defined in questions 2 and 3.
Test case:
> (Dividen Divide 64 2 10 3 4)
32 5/6
4. Re-implement the procedure Dividen Divide and name it (Dividen DivideLet u vxy n). In this question, you must use let-form to redefine the global procedures that you used in the previous questions. More specifically, you will use let-form to redefine Divide and nDivide as unnamed procedures and use them in the Dividen DivideLet procedure. Hint: Follow the car ABS and Traction control example given in the lecture.
Test case:
> (Dividen DivideLet 64 2 10 3 4)
32 2/5

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:00
For all machines-not just hammers- the user applies force force to the machine to the machine over a certain distance. a. input b. output c. duo d. none of the above
Answers: 1
question
Computers and Technology, 22.06.2019 14:30
If the polar bear were taken out of the food chain what would happen to the seal population the seal population would diminish the seal population would grow dramatically the seal population would stay the same the seal population would decrease slightly
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
Which of the following examples has four beats in each measure?
Answers: 2
question
Computers and Technology, 23.06.2019 17:30
When making changes to optimize part of a processor, it is often the case that speeding up one type of instruction comes at the cost of slowing down something else. for example, if we put in a complicated fast floating-point unit, that takes space, and something might have to be moved farther away from the middle to accommodate it, adding an extra cycle in delay to reach that unit. the basic amdahl's law equation does not take into account this trade-off. a. if the new fast floating-point unit speeds up floating-point operations by, on average, 2ă—, and floating-point operations take 20% of the original program's execution time, what is the overall speedup (ignoring the penalty to any other instructions)? b. now assume that speeding up the floating-point unit slowed down data cache accesses, resulting in a 1.5ă— slowdown (or 2/3 speedup). data cache accesses consume 10% of the execution time. what is the overall speedup now? c. after implementing the new floating-point operations, what percentage of execution time is spent on floating-point operations? what percentage is spent on data cache accesses?
Answers: 2
You know the right answer?
1. Define a procedure (Divide x y) that takes two parameters x and y and returns the division result...
Questions
question
Mathematics, 18.02.2020 05:59
Questions on the website: 13722367