1. What is a computer? Explain in words or draw a block diagram. Here is the answer.
2. Describe three differences between natural languages and formal languages. Here is the answer.
3. Convert to decimal: 1010 Answer: 10
4. Convert to decimal: 110111Answer: 55
5. Add these binary numbers: 11011 + 101. Answer: 100000
6. Convert to binary: 34. Answer: 100010
7. Convert to hex: 11000101. Answer: C5
8. Convert to binary: 7C Answer: 0111 1100
9. Convert to decimal: 2A Answer: 42
10. Convert from decimal to hex: 132 Answer: 84
11. Describe two characteristics of data determined by data type. Here is the answer.
12. Write the contract and header for a function to determine the area of a rectangle,, given its base and height.
;; area-rectangle: number number -> number
(define (area-rectangle length width) ...)
13. What value is produced by each of the following functions?
14. (>= −2 3) produces false
(>= 4 4) produces true
(and (> 3 7) (> 4 2))produces false
15. 14. Write a Boolean function for the following: #&x+1<2x-5#&
(< (+ x 1) (− (* 2 x) 5))
Computer Programming Answers to Study Guide For Final