CSE2305 - Object-Oriented Software Engineering
Self Assessment Questions
For each question choose the single response which best answers the question, or which completes the statement most accurately.
Question 1: | "Abstraction" is... |
Being distracted by your thoughts |
The classification of objects, grouped according to their significant similarities |
The classification of objects, grouped according to their significant differences |
The classification of objects, grouped according to their names |
Hiding information inside a class so that it can only be known in an abstract manner. |
Question 2: | Which of the following is not a type of object-oriented abstraction |
Abstraction of structure |
Abstraction of function |
Abstraction of purpose |
Abstraction of name |
All of the above are types of object-oriented abstraction |
Question 3: | Why is abstraction important in the real world? |
Because it gives us a means of reducing complexity to a manageable degree. |
Because the most important things (love, honour, justice) are all abstract |
Because it is one of the foundations of the object-oriented model. |
Because it allows us to ignore essential features of things |
Because it gives us a way of hiding information on a "need-to-know" basis |
Question 4: | Why is abstraction important in programming? |
Because it gives us a means of reducing complexity to a manageable degree. |
Because user-defined types are sometimes known as "abstract data types" |
Because it is one of the foundations of the object-oriented model. |
Because it allows us to ignore essential features of things |
Because it gives us a way of hiding data on a "need-to-know" basis |
Question 5: | Which of the following C constructs is an abstraction mechanism for the language? |
Functions |
Overloaded operators (e.g. + or /) |
Function pointers |
All of the above |
None of the above |
Question 6: | What is "encapsulation"? |
The division of a program into independent modules |
The enforcement of data hiding within a class |
The aggregation of data members within a class |
The aggregation of function members within a class |
Taking medication to help you program better |
Question 7: | Which of the following are benefits of encapsulation? |
Smaller executable and faster execution of code |
Localizes effects and therefore errors |
Prevents memory leaks and scope violations |
Automatic error messages |
None of the above |
Question 8: | Which of the following is a drawback of encapsulation? |
Can't be used in non-OO programming languages. |
Data hiding must be checked and enforced at run-time, so code may run slower. |
Data can only be accessed through specified interface functions, so executable may be larger and run slower. |
It prevents polymorphism |
None of the above |
Question 9: | If computing is about making data available in useful forms, why is data hiding important? |
Because some data is too sensitive to be made generally available |
Because some data should only be accessed in well-defined, well-controlled ways |
Because some data cannot be made available in useful forms. |
Because some data may be incorrect |
Computing isn't about making data available. |
Question 10: | How does encapsulation relate to abstraction? |
Encapsulation is a type of abstraction: abstraction of privilege |
Encapsulation is a type of abstraction: abstraction of structure |
Encapsulation is a type of abstraction: abstraction of function |
Abstraction is a type of encapsulation: encapsulation of concept |
It doesn't. They are entirely separate concepts. |
Last updated: July 18, 2005