Q.

Your chief Software designer has shown you a sketch of the new Computer parts system she is about to create. At the top of the hierarchy is a Class called Computer and under this are two child classes. One is called LinuxPC and one is called WindowsPC. The main difference between the two is that one runs the Linux operating System and the other runs the Windows System (of course another difference is that one needs constant re-booting and the other runs reliably). Under the WindowsPC are two Sub classes one called Server and one Called Workstation. How might you appraise your designers work?

A.  

Give the goahead for further design using the current scheme 

B.  

Ask for a re-design of the hierarchy with changing the Operating System to a field rather than Class type

C.  

Ask for the option of WindowsPC to be removed as it will soon be obsolete

D.  

Change the hierarchy to remove the need for the superfluous Computer Class.

Similar Questions
1. Which part of an object exhibits its state?
A.  

Data

B.  

Operations

C.  

Any public part

D.  

Any private part

2.

Inheritance is a way to

A.  organize data. B.  pass arguments to objects of classes. C.  

add features to existing classes without rewriting them.

D.  

improve data-hiding and encapsulation.

3.

Suppose you have batch een given the following design, "A person has a name, age, address and sex. You are designing a class to represent a type of person called a patient. This kind of person may be given a diagnosis, have a spouse and may be alive". 

Given that the person class has already been created, what of the following would be appropriate to include when you design the patient class?

A.  

registration date and diagnosis 

B.  

age and sex

C.  

sex and diagnosis

D.  

diagnosis and age

4. What problem(s) may occur when we copy objects without using deep copy constructor?
A.  

Dangling pointer

B.  

Memory Leakage

C.  

All of the given 

D.  

System crash

5. this pointers are not accessible for static member functions.
A.  

True 

B.  False
6. A static member function cannot be declared.
A.  

Static

B.  

Implicit

C.  

Explicit

D.  

Virtual

7. _______ remain in memory even when all objects of a class have been destroyed.
A.  

Static variables

B.  

Instance variable

C.  

Primitive variables

D.  

None of given

8. Friend functions are _____________ functions of a class.
A.  

None of given

B.  

object member

C.  

non-member

D.  data member=
9. ___________, which means if A declares B as its friend it does NOT mean that A can access private data of B. It only means that B can access all data of A.
A.  Friendship is one way only B.  

Friendship is two way only

C.  

NO Friendship between classes

D.  

Any kind of friendship

10.

The statement obj A=objB; will cause a compiler error if the objects are of different classes.

A.  True B.  

False 

OBJECT ORIENTED PROGRAMMING TOPICS