Podcast
Questions and Answers
What is the relationship between a type and its instances?
What is the relationship between a type and its instances?
- A type can only have a single instance associated with it.
- A type is an abstraction and instances are concrete entities created from that type. (correct)
- A type is a concrete entity and instances are abstractions of that type.
- A type and its instances are completely unrelated concepts.
What is the difference between an attribute and a behavior of an instance?
What is the difference between an attribute and a behavior of an instance?
- Attributes are the data members of a class, while behaviors are the member functions.
- Attributes are characteristics of an instance, while behaviors are the operations the instance can perform. (correct)
- Attributes are static properties of a class, while behaviors are dynamic properties.
- Attributes and behaviors are the same thing, just different names for the same concept.
What is the relationship between a class and an object?
What is the relationship between a class and an object?
- A class is a collection of objects, while an object is a single instance of a class.
- A class is a type and an object is an instance of that type. (correct)
- A class is a concrete entity and an object is an abstraction of that class.
- A class and an object are completely unrelated concepts.
What is the purpose of a data member in a class?
What is the purpose of a data member in a class?
Which of the following statements about types and instances is true?
Which of the following statements about types and instances is true?
What is the purpose of a member function in a C++ class?
What is the purpose of a member function in a C++ class?
How many sections are needed to write an object-oriented program in C++?
How many sections are needed to write an object-oriented program in C++?
What is the purpose of the const
keyword in the member function declarations getRadius()
and getArea()
?
What is the purpose of the const
keyword in the member function declarations getRadius()
and getArea()
?
What is the purpose of the using namespace std;
line in the code?
What is the purpose of the using namespace std;
line in the code?
What is the purpose of the double PI = 3.14;
line in the getArea()
and getPerimeter()
member function definitions?
What is the purpose of the double PI = 3.14;
line in the getArea()
and getPerimeter()
member function definitions?