Part 1, v1Final Test “Object-Oriented Programming 5.02.2024
Surround the true answer of the following questions:
1. What are the main principles of OOP?
A. encapsulation
B. inheritance
C. polymorphism
D. all of the above
2. What is the main usage of class constructors?
A. data initialization
B. providing a convenient way to free memory
C. to control data protection
D. to assure data transfer
3. Which is a protection level provided by classes in C++?
A. protected
B. private
C. public
D. all of the above
4. Which of the following is a valid class declaration?
A. class A { int x; };
B. class B { }
C. public class A { }
D. object A { int x; };
5. Which is the function that the console C++ application must contain?
A. start()
B. system()
C. main()
D. program()
6. What purpose do classes serve?
A. data encapsulation
B. providing a convenient way of modeling real-world objects
C. simplifying code reuse
D. all of the above
7. Why would you want to use inline functions?
A. To decrease the size of the resulting program
B. To increase the speed of the resulting program
C. To simplify the source code file
D. To remove unnecessary functions
8. What punctuation is used to signal the beginning and end of code blocks?
A. { }
B. -> and