OOP REVIEW Flashcards

1
Q

Describe the general process through which superclasses are created

A
• Superclasses are created through the process called "generalization“ 
Common features (methods or variables) are factored out of object classifications (ie. classes). 
Those features are formalized in a class. This becomes the superclass 
The classes from which the common features were taken become subclasses to the newly created super class
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the purpose of superclasses

A
Often, some superclass do not have a "meaning" or does not directly relate to a "thing" in the real world
• It is an artifact of the generalization process
• Because of this, abstract classes cannot be instantiated. They act as place holders for abstraction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Draw a UML showing the relationships between the abstract superclass vehicle and car and track

A

*See notes for UML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Write code to show how an abstract class employee can be made and inherited

A

*See notes for code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Struct and classes are present in the C++ programming language. What is the main
difference between struct and classes in the C++ programming language?

A

A structure is a collection of variables of different data types with the same name. A class in C++ is a single structure that contains a collection of related variables and functions. The struct keyword can be used to declare a structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly