1 Consider the implementation of a procedurePwith a formal parameterFPof typeT.
(a) Assume that the copy-in-copy-out parameter mechanism is used. What exactly is passed toP, a value or an address? What happens whenPis called? What happens insidePwhen it inspectsFP?What happens insidePwhen it updatesFP?What if anything happens whenPreturns?
(b) Repeat, this time assuming that the variable parameter mechanism is used instead.
2 Choose a programming language (such as C or PASCAL) that does not support packages, abstract types, or classes. (a) How would the trigonometric package of Example 6.2 be programmed in your language? (b) What are the disadvantages of programming in this way?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here