Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1.) An abstract data type is a data type that satisfies the following conditions

ID: 3716600 • Letter: 1

Question

1.) An abstract data type is a data type that satisfies the following conditions. Which one of the following choices is NOT correct?

A. The representation of objects of the type is hidden from the program units that use the type.

B. The only direct operations possible on those objects are those provided in the type’s definition.

C. The declarations of the type and the protocols of the operations on objects of the type provide the type’s interface.

D. The declarations of the type and the protocols of the operations on objects of the type are contained in a single syntactic unit.

E. The type’s interface does not depend on the representation of the objects or the implementation of the operations.

F. Other program units are not allowed to create variables of the defined type.

2.) There are several benefits of information hiding. (Note: Program units that use a specific abstract data type are called clients of that type.) Which one of the following statements is NOT correct?

A. One benefit is increased reliability as clients cannot manipulate the underlying representations of objects directly, either intentionally or by accident.

B. One benefit is increased reliability as objects can be changed only through the provided operations.

C. One benefit is it reduces the range of code and number of variables of which a programmer must be aware when writing or reading a part of the program.

D. The value of a particular variable can only be changed by code in a restricted range, making the code easier to understand and less challenging to find sources of incorrect changes.

E. One benefit is to make name conflicts less likely, because the scope of variables is extensive and wider.

Explanation / Answer

Q1.

Ans: F. Other program units are not allowed to create variables of the defined type.

Q2.

Ans: C. One benefit is it reduces the range of code and number of variables of which a programmer must be aware when writing or reading a part of the program.