Question: Considering the declaration package RationalNumber is type rational is private procedure mult(x in rational; -- y in rational; z out rational): private type rational is

Considering the declaration package RationalNumber is type rational is private procedure mult(x in rational; -- y in rational; z out rational): private type rational is record num, den: integer end record; end package: package body RationalNumber is procedure mult(x in rational, y in rational; z out rational) begin znum := x.num.y.num z.den:=x.den.y.den: end: end package; a. this declaration constitutes a composite data type O b. this declaration hides but doesn't encapsulate the implementation of rational c. based on this declaration if we write var A: rational, then Anum :=7 is illegal Od all the mentioned e. none of the mentioned Dynamic data types are implemented using a heap based on the operations: Get storage - allocate (x) free storage -free(x) Problem: Dangling and garbage cre occurred when we use the code: allocate (x); x+y; from(s) b. allocate(x); allocate(x) c. and respectively O d. band a respectively O e, none of the mentioned
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
