Instructor solution
You may exit out of this review and return later without penalty.
Inheritance and Interfaces
1.Suppose we made a function bigen that only evaluates and returns its last argument (arguably more efficient than begin). Give an example of some code for which when bigen would return something different than begin.
2.Write two check-equal? assertions that test (abs 5) and (abs -5).
3.What four elements make up one of our classes?
4.Why is it useful to have all classes subtype a single root class?
5.Let the class animal% have the fields (name species weight) and suppose the class student% inherits from animal with new fields (onyen Pid). What fields do we need to store in a new instance of student%?
6.What is the result of the following statement?
(third (read (open-input-string "(+ 2 (+ 3 4) 5)")))
7.What are the differences between methods, functions, and procedures?
8.Summarize what our evaluator does when we create an object using the new keyword.
9.What must we add to our language to support interface-style object-oriented programming?
You may exit out of this review and return later without penalty.