click below
click below
Normal Size Small Size show me how
COMPROG 7
| Question | Answer |
|---|---|
| Refers to binding together the data and the functions that manipulate them | Encapsulation |
| Which of the following cannot be passed to a function in C++? | Header File |
| How many classes can be defined in a single program? | As many as you want |
| It means displaying only essential information and hiding the details. | Abstraction |
| What operator is used to access a data member or a member function? | dot (‘.’) operator |
| Which of the following has a correct C++ class definition? | class Student {}; |
| What is the additional feature in classes that were not in structures? | Member Functions |
| Which of the following best defines a class? | Blueprint of an object |
| If there is a class named Student and you want to create an object name "firstyear", what would be the correct syntax | Student firstear |
| #include<iostream> using namespace std; int main() { class student { int rno = 10; } v; cout<<v.rno; } | Error |
| Which of the following term is used for a function defined inside a class? | Member Functions |
| What is the output of this program? class Test { int x; }; int main() { Test t; cout << t.x; return 0; } | Error (variable is private) |
| An object is a _________________ of a class | an instance |
| Function that has its definition or its prototype within the class definition like any other variable. | Member Functions |
| It refers to the blueprint of an object: | Class |
| If an object named Box has a member of length, what is the command to assign a value of 5 into it? | Box.length = 5; |
| If a class is named Fruits and you will create an object named Apple, what would be the statement? | Fruits Apple; |
| Which of the following is an abstract data type? | Class |
| Which of the following concepts means wrapping up of data and functions together? | Encapsulation |
| The default access specifier for the class members is: | private |
| Blueprint of an object | Class |
| Which concept of OOP is false for C++? | Code must contain at least one class |
| Which is not a feature of OOP in general definitions? | Duplicate/Redundant Data |
| What is the difference between struct and class in C++? | Members of a class are private by default and members of struct are public by default |
| Objects created are based on what? | Class |
| What is the difference between a struct and a class in C++? | A class has a default privacy specification of private |
| What symbol is used to define a function outside of the class? | ‘::’ |
| Which of the following concepts of OOPS means exposing only necessary information to the client? | Encapsulation |
| If a class is named Car and you will create an object named SportsCar, what would be the statement? | Car SportsCar; |
| A behavior an object | Method |
| Which of the following is an OOP language? | C++ |
| Which of the following operator is used for cout? | (<<) Insertion Operator |
| Which of the following statements is correct in C++? | Structures can have functions as members |
| If an object named Apple has a member named "price", what is the command to assign a value of 15 into it? | Apple.price = 15 |
| Which of the following are available only in the class hierarchy chain? | Protected Data Members |
| It is an identifiable entity with some characteristics and behavior. | Object |
| Pick out the other definition of objects. | Instance of the Class |
| Which of the following is correct about class and structure? | Class data members are private by default while that of structure are public by default. |