Excel Higher Secondary School8
description
Transcript of Excel Higher Secondary School8
X11 QUESTION BANK 15.CLASSES AND OBJECTS X11 ONE WORD
BOARD EXAM QUESTIONS
1. The most important feature of C++ is the ..[Mar-11,Jun-Oct-12]a) Variable
b) Array
c) Class
d) Pointer
2. In C ++, The functions are also called as .[Oct-10,12,Mar-11] a) Classes
b) Function
c) Arrays
d) Methods
3. ..is a way to bind the data and its associated functions together.
[Jun-08,09,Mar-09,10]a) Pointers
b) Methods
c) Classes
d) Pointer
4. A class specification has .parts.
[Oct-08,Mar-11]a) 4
b) 3
c) 2
d) 5
5. The body of a class is enclosed within .
[Oct-08,Mar-11]a) ( )
b) < >
c) { }
d) [ ]
6. The class declaration or body of a class is terminated by a .
[Mar-07,Jun-11,Mar-12]
a) :
b) ,
c) ( )
d) ;
7. The class body has .access specifiers.
[Jun-07]a) 2
b) 4
c) 3
d) 5
8. Which of the following is not a valid class access apecifier?
[Mar-07,Jun-12]a) Private
b) Class \
c) Protected
d) Public
9. Specifying visibility label is optional [Jun-08,Oct-09]a) Public
b) Private
c) Protected
d) Class
10. By default the members will be treated as .if visibility label is not mentioned.
[Oct-08,Mar,Oct-12]a) Class
b) Protected
c) Public
d) Private
11. The members that have been declared as ..can be accessed only from with in the class.
[Oct-09,11]a) Static
b) Auto
c) Public
d) Private
12. The members that have been declared as ..can be accessed from the class and the members of the inherited class.
[Jun-08,Oct-10]a) Private
b) Public
c) Auto
d) Protected
13. The members that have been declared as .can be accessed from outside the class also.
[Mar-08,10]a) Public
b) Private
c) Protected
d) Public, Private 14. The binding of data and functions together in to a single entity is referred to as .
[Jun-10,Mar-13]a) Encapsulation
b) Polymorphism
c) Inheritance
d) Data hiding
15. Instruments allowing only selected access of components to objects and to members of other classes is called
[Oct-12]a) Data processing
b) Data abstraction
c) Data updating
d) Sorting
16. Data abstraction is achieved through ..[Oct-07,Mar-08,10]a) Polymorphism
b) Encapsulation
c) Data updating
d) Sorting
17. Which is the key feature of object oriented programming?
[Jun-08,Mar-09,11,Oct-11]
a) Class
b) Data hiding c) Polymorphism
d) Pointer
18. Data members are also called as [Oct-09,Jun-10,11,12,Mar-12,13]a) Member functions
b) Pointers
c) Attributes
d) Methods
19. In C++ the class variable are known as
[Oct-07,Mar-10,Jun-11]a) Methods
b) Objects
c) Tags
d) Functions
20. The members of a class are accessed using the ..operator.
[Oct-07,Mar-07,08,09,10,11,12]a) Comma,
b) Semicolon ;
c) Dot .
d) Colon :21. Which operator is used to define function outside a class?[Oct-11]a) ;
b) :
c) ; ;
d) ?:
22. In C++, objects of a class are also called
[Oct-11]a) Instance
b) Constance
c) Tag
d) Data type
23. Member function can be of type
[Mar-12]a) Auto
b) Static
c) Extern
d) Class
24. Which one of the following is called the scope resolution operator in C++?
[Mar-12]a) :
b) : :
c) .
d) : ?
25. The static member variable is initialized to .[Jun-11,Oct-11]
a) 0
b) 1
c) True
d) False
26. How many copies of the static member variable is created?
Oct-09,Jun-09,Mar,11]a) 2
b) 5
c) 3
d) 1
27. Which statement can be read as stud is an instance object of the class student
[Mar-12]a) Stud student;
b) Class student stud;
c) Class student (stud)
d) student stud ;
28. The variable that is initialized only when the first object of the class is created is
[Mar-07,13,Oct-12]a) Static
b) Private c) Public
d) Protected
29. The class access specifier used to access friend function is [Mar-07]a) Private
b) Public
c) Protected
d) Both (a) and (b)
30. Which of the following statements is NOT true?
[Mar-07,10]a) Member functions can be of static type
b) The return type of a member function cannot be of object data type
c) A non member function cannot access the private data of a class
d) Several different classes can use the same function name
31. Class comprises of .
[Jun-07,Oct-09]a) Data members
b) Member function
c) Both (a) and (b)
d) None of these
32. Private access specifier is accessible by special function called
[Jun-07,Oct-10]a) Void
b) Inline
c) Friend
d) All of these
33. Class product
[Jun-07,Oct-12]
{
Int c,q;
Flot p;
}p1;
The number of a bytes occupied by p1 is
a) 7
b) 8
c) 9
d) 10
34. A class belong to which of the following data types?
[Jun-07,11,12,13]a) User defined type
b) Built in type
c) Derived type
d) Array type
35. A member function can call another function directly without using dot operator is called
[Oct-7,Mar-09]a) Nesting of member function b) Recursive functions
c) Friend function
d) Inline function
36. The member function declared under .scope can be accessed by the objects of that class
[Oct-07]a) Public
b) Private
c) Global
d) Protected
37. When a member function is defined within the class, it behaves like .function
[Mar-08,09,Jun-11]a) Inline
b) Friend
c) Public
d) Private
38. The variable shared by all the objects of a class, has the data type
[Mar-08]a) Static
b) Auto
c) Extern
d) Private
39. Which is the default access specifier in the class? OR
Which of the following class access specifiers is optional?
a) Private
b) Public
c) Protected
d) None of these
40. The members of the calss are accessed by using a/an
[Mar-09,Oct-11] a) Increment operator
b) Decrement operator
c) Scope resolution operator d) Dot operator
41. Class name is also called
[Jun-08]a) Function
b) Member
c) Method
d) Tag
42. Which has scope or visibility within the class but its life time is the life time of the program?
[Jun-10]a) Data members
b) Member function
c) Static data members
d) Constructors
43. Which of the following is true?
[Jun-10]a) Member function can be defined outside the class also
b) Member function cannot be defined outside the class
c) All member function must have same name
d) A class cannot have more than three member functions
44. When object is created, no separate space is allocated for[Jun-10]a) Objects
b) Member functions
c) Data member
d) Static member
45. Class example
[Jun-10]{
int x,y,z;
flot m,n;
}p[5];
In the above snippet, how many objects are created?
a) 3
b) 4
c) 5
d) 1
46. Class product
[OctJun-09]{
int a,b;
float b;
Public:
void assign_data ( );
void display ( );
};
void main ( )
{
product p1,p2;
}
The no. of memory bytes allocated for the variable p1 is
a) 12 bytes
b) 10 bytes
c) 8 bytes
d) 4 bytes
Read the following program carefully and answer questions from 56 to 58
[Oct-10]
# include
# include < conio.h>
class item
{
int code, quantity);
float price;
void get data ( ) ;
protected :
void compute ( );
public :
float tax ;
void putdata ( );
};
void main ( )
{ item I;
} 47. Memory allocation for instance i is
a) 12 bytes
b) 10 bytes
c) 8 bytes
d) 16 bytes
48. Public data member in the above class definition isa) Code
b) Quantity c) Price
d) Tax
49. Method that can be acceaaced by object is
a) get data ( )b) quantity c) price
d) tax
50. Class comparise
[Jun-12]a) Data members, member name
b) Data function, system function
c) Data members, member function
d) Data name, member type
Read the following program snippet and answer the questions from 51-53
[Mar-13]
class student
{
private:
int roll_ no, mark 1;
public :
{
cout > roll_no >>mark 1;
}
};51. What is the name of the class?
a) Class
b) Student
c) Accept
d) Public
52. What is the name of the member function?
a) Roll_no
b) Void
c) Accept
d) Mark 1
53. What is the name of the constructor?
a) Accept
b) Roll_no
c) Mark 1
d) Student CREATED QUESTIONS
54. The most important feature of C++ is the
a) integer
b) float
c) class
d) arrays
55. Bjarne stroustrup initially named C++ as
a) advanced C
b) D
c) Deep C
d) C with class
56. Which one of the following language features classes?
a) BASIC
b) C
c) C++
d) None
57. Declaration and function definitions are two specifications of which of the following..
a) data type
b) class
c) comments
d) none of the given
58. Which of the following is a user defined data type/?
a) class
b) object
c) public
d) protected
59. Declaration of class member are declared as private can be accessed only ..
a) with in class
b) outside the class
c) inside or outside the class
d) separately in another class
60. Class access specifiers are also known as.
a) specifications
b) class depth
c) visibility labels
d) class visibility specifications
61. The members declared as can only be accessed with in class
a) private
b) public
c) protected
d) class
62. OOP stands for
a) Object Oriented Process
b) Online Object programming
c) Object oriented Programming
d) Object to Object Programming
63. of a class are data variables that represents the features or properties of a class
a) data members
b) member functions
c) access specifiers
d) visibility labels
64. .are the functions that perform specific tasks in a class
a) data members
b) member functions
c) concrete functions
d) data functions
65. Members of a class are classified as
a) data members and member functions
b) data variables and data hiding
c) data hiding and data abstractions
d) data functions and member functions 66. Class student
{
Int x,y;
} S1,S2;
From the above code,S1,S2 are
a) object of class student
b) similar classes of student
c) super class of student
d) sub class of student
67. Void sum :: input ( )
The above line tells .
a) function sum is declared with in the class input
b) function input is declared with in class sum
c) function sum is sub function of input
d) functions input is sub function of sum
68. Int ex: : output ( )
Which of the following is true with reference to the above line
a) the functions ex returns integer type of data
b) the class output return integer type of data
c) the function output returns ex type of data
d) the function output returns integer data type
69. : :is a
a) short circuit AND
b) short circuit OR
c) not operator
d) scope resolution operator
70. When an object of a class are created, separate memory is allocated for?
a) member function only
b) member variables only
c) both member variables and member functions
d) neither functions nor variables
71. The return type of a number function of a can be ..
a) only a valid C++ data type
b) only object data type
c) a valid C++ data type or object data type
d) none of the given
72. The member functions of a class can receive arguments of ..
a) C++ data type only
b) C++ data type or object data type
c) only object data type
d) no data type
73. The life time of a static member variable is same as
a) the first object of its class
b) the private of variable of any object
c) the public variable of any object
d) life time of the program74. class example
{
int x,y,z;
float m,n;
}p[4];
By the above code how many objects of the class example are created?
a) 3 b) 4 c) 5 d) 175. Private access specifier is accessible by special function called ..
a) void
b) inlinec) friend d) all of these
76. Which of the following functions initializes the class object ?
a) destructor
b) pointer
c) constructor
d) operator overloading
77. Which of the following class access specifiers is optional?
a) public
b) protected
c) private
d) class
BOARD EXAM ANSWERS:12345678910
cbdccdcbBd
11121314151617181920
ddaabcbcBc
21222324252627282930
cabbaddaAb
31323334353637383940
ccbaaaaaAd
41424344454647484950
dcabccadCc
515253
bcd
CREATED ANSWERS:54555657585960616263
cccbaacaca
64656667686970717273
baabddbcbd
74757677
bccc
1