Flashcards
OOP Phase Test
Flashcards do conjunto (23)
- 1What is a const qualifier?The qualifier const can be applied to the declaration of any variable to indicate that its value will not be changed
e.g. const MOUSE = 'M'; - 2What type of constructor is Cat cat(); ?Default Constructor
- 3A pointer contains......a memory address of their value!
e.g. int *aPointerVar; - 4What type of code is this? &someCode;A memory address.
These can be used in pointers to point to a memory address. - 5What kind of relationship would the following be: Player* player = p_player;Direct Association
- 6What type of relationship would this be: private Score score_ = new Score();Composition
- 7If a object needs to know another object (but not to modify it), what type of relationship would it be?Association
- 8Can private member functions be assigned to other classes directly?No
- 9What are dice1_ and dice2_ the instance of shown below? class Game { private Dice dice1_, dice2_; public: Player getPlayer() const; };Dice
- 10Does a class member always has to be const?No
- 11What is cohesive?It is the code and how it all works together
- 12What is Coupled?The interaction between two classes
- 13To be easy to maintain, reuse and test a software module should be......Highly cohesive and loosely coupled
- 14Can ANKsvn solve problems in code?No, ANKsvn identifies the conflict but cannot solve it.
- 15Operator overloading is......a form of function overloading.
(Overload operators can work in private function) - 16In OOP, what cant you do when calculating values from a object?You cannot put direct values into it.
(e.g. t = t + ct; //Correct
t = 12 + t; //Incorrect) - 17Can you return a value that is private?No, you will get a error if that happened!
- 18What does the class name and operation name in C++ look like?ClassName operationName
- 19When writing a class, what structure should it look like?class Mouse{
public:
int getX();
int getY();
private:
int x_, y_;
} - 20What is a function member?A function member is all the classes that can be accessed for both public and private operations.
class TIme{
public:
//function member
private
//function member
} - 21What does this operator represent? x_, mouseY_, etc.Accesses the member of the instance.
- 22What is :: and when is it used?Scope Resolution Operator
These are placed before a member function name.
int Time::getHours() const {
return hours_;
} - 23Define what an association relationship between two classes in an OO system is and explain what it is used for.Try it yourself!!!
Informações
- Descrição
- FlashCards sobre OOP Phase Test, criado por b3014292 em 08-02-2015.
- Criado por
- b3014292
- Visualizações
- 10
- Avaliação