click below
click below
Normal Size Small Size show me how
F8-FORMATIVE CCS0007
[F8-FORMATIVE] Formative Assessment 8 - Introduction to OOP
| Question | Answer |
|---|---|
| Refers to binding together the data and the functions that manipulate them Group of answer choices Encapsulation Objects Class Abstraction | Encapsulation |
| It is an identifiable entity with some characteristics and behavior Group of answer choices Object Methods Class Properties | Object |
| If there is a class named Student and you want to create an object name "firstyear", what would be the correct syntax Group of answer choices Student firstyear student firstyear() student first year; student firstyear | Student firstyear |
| How many classes can be defined in a single program? Group of answer choices Only 100 Only 999 Only 1 As many as you want | As many as you want |
| Which of the following best defines a class? Group of answer choices Scope of an object Instance of an object Parent of an object Blueprint of an object | Blueprint of an object |
| Which of the following is an OOP language? Group of answer choices HTML C C++ BASIC | C++ |
| What is the output of the given program? #include<iostream> using namespace std; main() { class student { int rno = 10; } v; cout<<v.rno; } Group of answer choices 0 Garbage value 10 Error | Error |
| Which concept of OOP is false for C++? Group of answer choices At least one object should be declared in code Code must contain at least one class A class must have member functions Code can be written without using classes | Code must contain at least one class |
| Pick out the other definition of objects. Group of answer choices associate of the class member of the class attribute of the class instance of the class | instance of the class |
| Which of the following cannot be passed to a function in C++ ? Group of answer choices Header file Structure Array Constant | Header file |
| Which of the following is an abstract data type? Group of answer choices class string double int | class |
| A Function that has its definition or its prototype within the class definition like any other variable. Group of answer choices Member Functions Data Member Class Objects | Member Functions |
| If an object named Box has a member of length, what is the command to assign a value of 5 into it? Group of answer choices Box(5) Length = 5; Box.length = 5; Box.length == 5; | Box.length = 5; |
| What is the difference between a struct and a class in C++? Group of answer choices A struct cannot have private members. A struct cannot have member functions A class has a default privacy specification of public. A class has a default priva | A class has a default privacy specification of private |
| Which of the following are available only in the class hierarchy chain? Group of answer choices Protected data members Private data members Member functions Public data members | Protected data members |
| Which of the following concepts means wrapping up of data and functions together? Group of answer choices Encapsulation Object Abstraction Inheritance | Encapsulation |
| If a class is named Fruits and you will create an object named Apple, what would be the statement? Group of answer choices Apple@Fruits; Fruits Apple; Fruits(Apple); Apple Fruits; | Fruits Apple; |
| Which of the following statements is correct in C++? Group of answer choices Classes cannot have data as protected members. Structure members are private by default Structures can have functions as members Class members are public by default. | Structures can have functions as members |
| It refers to the blueprint of an object: Group of answer choices Access Modifier Data Inheritance Class | Class |
| The default access specifier for the class members is: Group of answer choices protected public none of the given private | private |
| Blueprint of an object Group of answer choices Class Inheritance Object Data Members | Class |
| What operator is used to access a data member or a member function? Group of answer choices dot (.) operator & operator == operator + operator | dot (.) operator |
| It means displaying only essential information and hiding the details. Group of answer choices Abstraction Class Methods Object | Abstraction |
| Which of the following has a correct C++ class definition? Group of answer choices class Student () class Student; class Student {}; class Student {}: | class Student {}; |
| Objects created are based on what? Group of answer choices behavior class abstract attributes | class |
| What is the output of the given program? #include <iostream> using namespace std; class Test { int x; }; int main() { Test t; cout << t.x; return 0; } Group of answer choices Garbage value 0 1 Erro | Error |
| What is the output of this program? class Test { int x; }; int main() { Test t; cout << t.x; return 0; } Group of answer choices 0 Error Garbage value | Error |
| An object is a _________________ of a class Group of answer choices an encapsulation a member function an interface an instance | an instance |
| Which of the following cannot be passed to a function in C++? Group of answer choices header file array constant structure | header file |
| Which of the following term is used for a function defined inside a class? Group of answer choices Class function Member function Member Variable Classic function | Member function |
| What is the difference between struct and class in C++? Group of answer choices All of the given All members of a structure are public and structures don't have constructors and destructors All members of a structure are public and structures do | Members of a class are private by default and members of struct are public by default. |
| What is the output of the given program? #include<iostream> using namespace std; main() { class student { int rno = 10; } v; cout<<v.rno; } Group of answer choices Error 0 10 | Error |
| Which of the following is correct about class and structure? Group of answer choices class data members are public by default while that of structure are private. Pointer to structure or classes cannot be declared. class data members are private | class data members are private by default while that of structure are public by default. |
| If a class is named Car and you will create an object named SportsCar, what would be the statement? Group of answer choices SportsCar Car; Car SportsCar; Car (SportsCar); Car<SportsCar>; | Car SportsCar; |
| If an object named Apple has a member named "price", what is the command to assign a value of 15 into it? Group of answer choices Apple(15); Price(15); Apple.price = 15; Apple.price == 15; | Apple.price = 15; |
| Which of the following concepts of OOPS means exposing only necessary information to the client? Group of answer choices Abstraction Encapsulation Data hiding Data binding | Encapsulation |
| A behavior an object Group of answer choices Property Method Abstract class | Method |
| Which is not a feature of OOP in general definitions? Group of answer choices Efficient code Modularity Code reusability Duplicate/Redundant Data | Duplicate/Redundant Data |
| What is the output of the given program? #include<iostream> using namespace std; main() { class student { int rno = 10; } v; cout<<v.rno; } Group of answer choices Error Garbage value 10 0 | Error |
| What is the additional feature in classes that were not in structures? Group of answer choices Data members Static data allowed Member Functions Public access specifier | Member Functions |