Tuesday, February 11, 2014

MCQ - Volume II - C++ Full


1. Object oriented concepts using C++


1. ___ is a tool to solve a wide range of problems

 a) Computer b) Calculator c) Abacus d) CPU

2. The solutions to the problems are in the form of computer program or ____.

a) System software b) Application software c) Hardware d) Software

3. ___ Statements provide instructions to the computer on the operations that need to be

performed on the data items.

a) Control b) Assignment c) Looping d) Unconditional

6. A group of the data and the operations are termed as _____

 a) Object b) data c) Function d) Operations

8. The operations represent the _____ of the object.

a) Behaviour b) Data c) State d) Function

10. Which is a kind of a self-sufficient subprogram with a specific functional area?

a) Object b) Inheritance c) Functions d) Encapsulation

12. The mechanism by which the data and functions are bound together within an object

is called as____. 

a) Overloading b) Overriding c) Encapsulation d) polymorphism

13. The ability of an object to respond differently to different message is called ____.

a) Function b) Polymorphism c) Draw( ) d) Overriding
14. The process of acquiring base class properties is called _____.

a) Inheritance b) Class c) Polymorphism d) Object

15. The ___ are power packed, as they include the functionality of the base class

along with its own unique feature.

a) Derived classes b) Base class c) Class d) Object

16. ____ allows a class to be derived from an existing class.

a) Polymorphism b) Inheritance c) Encapsulation d) Object.

17. The derived class are ____ Packed.

a) Completely b) Uniquely c) Power d) Cover

18. A template for entities that have common Behaviour is ____

a) Class b) Object c) Methods d) Attributes

19. C++ belongs to which category of programming language?

a) Structured b) Object oriented c) modular d) Procedural

20. The group of data and operations together are known as ______

a) Class b) Function c) Structure d) Object

21. Which one operates on a set of known input data items?

a) Computer program b) human ware c) System d) output data

22. _______ statements provide instructions to the computer on the operations that need

to be performed on the data items.

a) Control b) Assignment c) looping d) Unconditional


2. Overview of C++

1. C++ was developed by ____.

 a) James Goling b) Bjarne stroutstrup

c) John Kemney d) Thomas kushz

2. Rick Masciti coined the name _____. a) C++ b) BASIC c) COBOl d) Visual
3. The basic types are collectively called as ____.

a) Token b) Variables c) Characters d) Variable

4. ____ is the smallest individual unit in a program.

a) Token b) Character c) Control d) Variable

5. Which one gives special meaning to the language compiler?

a) Compiler b) Keywords c) Variable d) Constants

6. ____ modifiers allows the variable to exist in the memory of the computer, even if its

function or block looses its scope.

 a) auto b) static c) extern d) register

7. Which one holds the values or constants in memory boxes?

a) Variable b) While c) Switch d) go to

8. The ____ symbol is used to declare a pointer variable. a) * b) & c) # d) /

9. What are the assign bitwise assignment operator? a) &= b) ^= c) 1= d) all

10. Built in data type is also called as ____ datatype.

a) Fundamental b) Secondary c) Integer d) Void

11. Static and register variables are automatically initialized to ____ value when they are

declared ______ a) 1 b) 2 c) 3 d) 0

12. _____ type is further divided into int and char.

a) Integral b) Int c) Char d) Float

13. When a=5,c=-- what will be the value of c? a) 5 b) 6 c) 4 d) 8

14. What type of integer starts with OX?

a) octal b) Hexadecimal c) Binary d) decimal

15. ____ Data types are structure, union, class and enumeration.

a) User defined b) Built-in c) Derived d) Integer

16. The constant that should not have fractional part is ______.

a) Float b) Double c) Integer d) Exponent

17. How many operators are classified in C++? a) 11 b) 13 c) 14 d) 15

18. How many fundamentals data types are there in C++? a) 1 b) 2 c) 3 d) 4

19. Which is the conditional operator? a) ? b) > c) < d) ?:

20. The operands and the operators are grouped in a specific logical way of evaluation is

called……. a) Class b) Association c) Assignment d) Arithmetic

21. When a = 6 and c = a++ what is the value of c? a) 6 b) 7 c) 8 d) 5

22. What will be the value stored in C when a = 20,b=20, c(a<b)?a*a:b%a;______ a)

a) 0 b) 400 c) 40 d) 20

23. Which punctuator is used to terminate a C++ statement? a) ; b) : c) * d) ,
24. How many C++ data types are broadly classified? a) 2 b) 3 c) 4 d) 5

25. ___ data type enables to invent his own data type define values

a) User defined b) Derived c) Floating d) Integral

26. ____ allows users to define the user defined data type identifier.

a) Type definition b) Identifier c) Data d) Class

27. ____ data types helps users in creating a list of identifiers

a) Int b) Float c) Char d) Enumerated

28. ____ class is another qualifier that can be added to a variable declaration

a) Storage b) Sub c) Static d) register

29. Static register variables are automatically initialized to ____ value when they are

declared. a) 1 b) 2 c) 0 d) 3

30. Auto variable get undefined values known as _____

a) Garbage b) Auto c) Register d) Static

31. ____ Storage class defines local variable known to the block in which they are

defined? a) Static b) Auto c) Extern d) register

32. Storage class variables defined with in a function or a block cease to exist, the

moment the function or block looses its scope____.

A) Auto b) Static c) Extern d register

33. ___ Modifiers allows the variable to exist in the memory of the computer, even if

its function of block looses its scope. A) Auto b) Static c) Extern d register

34. ____ storage class global variable known to all functions in the current program

a) Auto b) Static c) Extern d register

35. ___ storage class variables are defined in another program.

a) Auto b) Static c) Extern d register

36. Built in data type is also called as ____ data type

a) Fundamental b) Secondary c) Integer d) Void

37. How many storage specifiers are there in a C++? a) 3 b) 4 c) 5 d) 3

38. ___ type is used to declare a generic pointer in C++.

a) Float b) Void c) Static d) Int

39. Signed, unsigned, long and short are some of the ____.

a) Data b) Derived data c) Modifiers d) Void

40. What is the range for char data type in C++?

a) -126 to 127 b) 128 to -127 c) -128 to 127 d) -127 to 128

41. What is the range for int data type in C++?

a) -32767 to 32768 b) -32768 to 32767 c) 32768 to 32769 d) 32767 to -32768

42. The long int, signed long int has ___ bytes. a) 2 b) 4 c) 3 d) 8

43. ___ is a variable that holds a memory address.

a) Pointer b) Char c) Float d) Long double

44. Integer values are stored in ___ bit format in binary form.

a) 8 b) 16 c) 32 d) 64

45. ___ bit is also called as the most significant bit or sign bit.

a) 15th b) 16th c) 18th d) 19th

46. The 16th bit will have a value ___ if negative value is stored. a) 1 b) 0 c) -1 d) 2

47. The unsigned char, and char data types has____ bits.a) 8 b) 16 c) 32 d) 64

48. What is the length of double data type? a) 32 b) 8 c) 16 d) 64

49. __ is an operator which returns the memory size requirements in terms of bytes.

a) size of( ) b) Long c) Size d) Double

50. In an examble long double a; int b; a=6,b=4 what is the output of size of (a*b)?

a) 8 b) 10 c) 4 d) 2


3. Basic statements

1. How many methods are there for assigning data to the variables in C++?

a) 2 b) 3 c) 4 d) 5

2. Data is read from the keyboard during run time by using the object____

a) Cin b) cni c) nci d) nic

3. The declarations for the object cin are available in header file called as____.

a) istream.h b) istream c) stream.h d) stream

4. ____ file comprises of all standard declarations and definitions for predefined functions.

a) Header b) Footer c) istream d) iostream

5. Program statement that causes jumps are called as ____ statements or structures

a) Control b) assignment c) increment d) decrement

6. The multiple branching statement is _____ statement.

a) If b) Switch c) For d) While

7. How many kinds of loops are there in C++? a) 1 b) 2 c) 3 d) 4

8. A loop embedded within another loop is called____.

a) Nested b) Loop c) Break d) Continue

9. A program written in high level language is called as ____.

a) Object code b) Source code c) Executable code d) All of these

10. How many times the following loop will be executed? For(i=1;i<6;i++)

a) 1 b) 5 c) 6 d) 7

11. The break statement would exit only____.

a) Current loop b) Current function c) Current program d) None

12. In C++ which file comprises the combined properties of istream and ostream?

a) stdio.h b) string.h c) conio.h d) iostream.h

13. Which of the following functions will be executed first automatically, when a C++

program is executed? 

a) Void b) Main c) Recursive d) Call by reference

15. Which of the following functions will be executed first automatically, when a C++

program is executed? a)Void b) main c) Recursive  
d) Call by reference 

16. How many times the following loop will be executed ?


Int ctr = 1;
for(;ctr<10;ctr++)
{
Cout<<ctr;
}

a) 1 b) 10 c) 11 d) 9


18 . Find the output

Int ctr = 1;
for(;ctr<10;ctr++)
{
Cout<<ctr;
Ctr = 1;
}

a) 1 infinitive b) 1,2,3,4,5,6,7,8,9,10 c) 1,2,3,4,5,6,7,8,9 d) 1,1,1,1,1,1,1,1,1,1


4. Functions
1. ___ are the building blocks of C++ programs.

a) Functions b) if - else c) For d) Switch

2. The starting point for the execution of a program is ____.

a) Main ( ) b) Void ( ) c) Public d) Class

3. The calling function parameters are called as____ parameters

a) Formal b) Actual c) Dummy d) Duplicate

4. In call by value method, the flow of data is always from the ___ statement to the

function definition.

 a) Call b) return c) function d) go to

5. In ___ method the called function argument formal parameters become alias to the

actual parameter. a) Call by value b) Call by reference c) return d) call

6. The functions that return no value is declared as ____.

a) Null b) Void c) Static d) public

7. An ____ looks like a normal function in the source file but inserts the functions code

directly into the calling program. a) inline b) online c) mainline d) line

8. To make a function inline one has to insert the keyword ___ in the function header.

a) inline b) online c) mainline d) line

9. Inline keyword is just a request to the ____.

a) Compiler b) Interpreter c) Linker d) Object

10. How many types of scopes in C++? a) 2 b) 3 c) 4 d) 5

11. In __ scope a local variable is defined is defined within a block.

a) File b) Function c) Local d) Class

12. A block of code begins and ends with___. a) { } b) [ ] c) ( ) d) { ]

13. ___ scope of variables declared within a function is extended to the function block and

all sub blocks therein. a) File b) Function c) Local d) Class


14. A variable declared above all blocks and functions has the ____ scope.

a) Scope of a file b) Local scope c) Function scope d) Class scope

15. Which of the following is NOT true, related to functions?

a) The actual parameters can be passed in the form of constants to the formal

parameters of value type.

b) The actual parameters can be passed only as variables to formal parameters of

Reference type.

c) The default value in the formal parameters can be given in the form of variable

initialization

d) The default value for an argument can be given in between the argument list

16. In the following code, the scope of the variable a is _______.

if(x<y)
{
Int ;
a++;
}

a) Local scope b) Function scope c) File scope d) Class scope

17. A function can be invoked from another function using its__________

a) Variables b) Name c) return d) Value

18. Which function executes faster but requires more memory space?

a) Normal function b) Void function c) Regular function d) Inline function

19. The scope of any variable used in the entire program is ____

a) Local b) File c) Function d) Class

20. The return type of the function prototype float powert(float,int) is ___.

a) Char b) Double c) int d) float

Read the following coding and give the answer

#include<iostream.h>
int n1=10;
void main()
{
int n2 =20;
if(n1>n2)
{
int temp;temp=n1;n1=n2;n2=temp;
}
Cout<<’\n’<<n1<<’\n’<<n2;
}

21. file scope_______. a) n1 b) n2 c) temp d) None of these

22. Function scope _______. a) n1 b) n2 c) temp d) None of these

23. Local scope _________. a) n1 b) n2 c) temp d) None of these



5. Structured Data types - Arrays

1. An ____ is a collection of variable of the same type that are referenced by a common

name. a) Variable b) constant c) array d) program

2. Arrays are of ____ types. a) 3 b) 4 c) 2 d) 1

3. ____ dimensional array comprising of finite homogenous elements.

a) 1 b) 2 c) Multi d) 3

4. ___ dimensional array comprising of elements each of which is itself a one dimensional

array. a) 1 b) 2 c) Multi d) 3

5. int num_array[5]; is this array how many integer values can be stored?

a) 4 b) 5 c) 6 d) 1

6. The size of the array should always be ____.

a) Positive b) negative c) whole number d) real number

7. Each element of the array is accessed by the _____ name and position of the element in

the array. a) Array b) variable c) Dimensional d) Subsciript

8. int days [ ] = {1,2,3,4,5,6,7); in this statement, what is the size of the array?

a) 6 b) 5 c) 4 d) 7

9. cin>>number[4]; in this array processing which reads the ___ elements.

a) 4th b) 5th c) 1st d) 3rd

10. number[3]++ in this array processing which increments the value stored as

_____ element By 1. a) 4th b) 5th c) 3rd d) 2nd

11. The process of arranging the data in a given array is called____.

a) Merging b) ordering c) Filtering d) Sorting

12. ____ are otherwise called as literals. a) Strings b) Constants c) Variables d) Data

13. A character array should be terminated with a ____ character.

a) ‘0’ b) ‘\0’ c) ‘0/’ d) \0

14. ____ is a member function of standard input istream.

a) getline() b) get() c) getsline() d) line()

15. ____ is a member function of standard output ostream.

a) Write() b) Print() c) writes() d) reads()

16. All member functions of a class, should be accessed through an ___ of class.

a) Object b) Instance c) A and B d) function

17. _____ parameters are required for write function.

a) 2 b) 3 c) 4 d) 5

18. String manipulations are defined in ____ header file.

a) string.h b) String c) st.h d) std.h

19. ____ function returns the number of characters stored in the array.

a) strlen() b) str() c) stlen() d) strlength()

20. ___ functions copies source string to target string.

a) strcpy() b) str() c) scpy() d) stcp()

21. _____ function compares the two given strings.

a) strcpy() b) strlen() c) stcrsmp() d) strcmp()

22. ___ dimensional array is an array in which each elements it itself an array.

a) 2 b) 3 c) 4 d) 1

23. The number of elements in a 2-dimentional by multiplying number of ____ with number

of _____. a) rows,columns b) columns,columns c) row,row d) row,coln

24. The subscript always commences from_____. a) 1 b) 2 c) 4 d) 3

25. If the elements are stored in row wise manner it is called as ____ order.

a) row - major b) column - major c) row d) column

26. When elements are stored column wise manner it is called as _____ order.

a) column - major b) row - major c) row d) column

27. A ___ is a set of mn numbers arranged in the form of a rectangular array of m rows and

n columns. a) matrix b) Determinant c) array d) row.

28. The ____ character is very important, as it acts as the string terminator.

a) Null b) String c) int d) float

29. Matrices can be represented through ___ arrays.

a) single b) 2 -D c) 3 - D d) multi - dimensional

30. Character array should be initialized using ___ quotes.

a) Single b) no c) double d) any

31. An integer array with index from 0 to 4 all having value 1 may be declared and

initialized____. a) int x[4] = {1} b) int x[4]={1,1,1,1) c) int x[5]=(1,1,1,1,1) d)int x[] = {}

32. The function strcpy(s1,s2)____ 


a) copied s1 to s2 b) copies s2 to s1

c) appends s1 to end of s2 d) appends s2 to end of s1.

33. Which of the following is a derived data type?

a) Union b) float c) Double d) Array

34. Arrays in C++ belong to which of the following data type?

a) Basic b) Derived c) User defined d) Primitive

35. In a 2-D array, the first sub-script stands for_______.

a) row b) column c) diagonal d) object


6. Classes and Objects

1. Which of the following is a way to bind the data and its associated functions together?

a) Class b) Data c) Functions d) Methods

2. The most important feature of c++ is the ___.

a) Integer b) float c) class d) arrays

3. In c++ functions are also called ___.a) Definitions b) concepts c) organisers d) methods

4. Declaration and function definitions are two specifications of which of the following__.

a) data type b) Class c) Comments d) none of the given

5. Which of the following is a user defined data type?

a) Class b) Object c) Public d) Protected

6. The body of the class starts and ends with_______.

a) Semi colon b) Begins and end c) Start and stop d) Braces i.e. { }

7. Declaration of class members are declared as private can be accessed only ____.

a) Within class b) outside the class 


c) inside or outside the class d) separately in another class

8. The class body has ___ access specifiers. a) 1 b) 2 c) 3 d) 4

9. Class access specifiers are also known as ____. 


a) Specifications b) Class depth

c) Visibility labels d) Class visibility specifications

10. By default class members are treated as ____ .

a) Public b) Private c) Protected d) Unprotected

11. Which of the following is not a valid class specifiers?

a) Public b) Private c) Protected d) Pointer

12. The member declared as ___ can only be accessed within the class.

a) Private b) Public c) Protected d) Class

13. The class members declared___ can be accessed only within the class and the

members of the inherited classes. a) Private b) Public c) Protected d) Unprotected

14. The member functions declared under which scope can be accessed by the objects of

that class? a) Private b) Public c) Protected d) Global

15. The binding of data and functions together into a single entity is known as ___.

a) Inheritance b) Polymorphism c) Overloading d) Encapsulation

16. Data hiding refers to __________.

a) Members and functions of a class are not accessible by members of outside class
b) Declaring members as public c) Not giving names to data
d) Not specifying members and functions of a class

17. Data abstraction in c++ is achieved by ____.

a) Inheritance () b) Polymorphism () c) Overloading () d) Encapsulation ()

18. OOP stands for ______. a) object oriented process b) object oriented programming

c) Online objects programming d) object to objects programming

19. __ of a class are data variables that represents the features of properties of a class.

a) Data members b) Member functions c) Access specifiers d) Visibility labels

20. ___ are the functions that perform specific task in a class.

a) Data members b) Member functions c) Concrete functions d) data functions

21. In a class data members are also called as ___.

a) Abstracts b) properties c) Attributes d) Dimensions

22. class student

{
int x,y;

} s1,s2;

From the above code s1,s2 are ____.

a) Objects of class students

b) Similar classes of students c) super class of students d) Sub class of students

23. The members that can also be accessed from outside the class should be declared as

___. a) private b) Public c) protected d) None of these

24. The member of a class are accessed ____. 


a) Only by member functions of its own class

b) By any functions c) Only by friend functions

d) Only by member functions of its own class and friend functions

25. The class access specifiers used to access friend functions is ______.

a) Private b) Public c) protected d) Both (B) and (C)

26. The members defined within the class behave like ___ functions.

a) Public b) Friend c) Inline d) None of these

27. void sum:: input() The above line tells _______.

a) Functions sum is declared within the class input

b) Function input is declared within class sum

c) Function sum is sub function of input.

d) Function input is sub function of sum.

28. Which of the following statements is NOT true?

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.

29. :: is a ________. 


a) Short circuit AND b) short circuit OR

c) Not operator d) Scope resolution operator.

30. When objects of a class are created separate memory is allocated for?

a) Member functions only b) Both member variables and member functions

c) Member variables only d) Neither functions nor variables.

31. One copy of ___ data members of a class are shared by all objects of that class.

a) Inline b) Private c) Static d) Public

32. ___ member variable are initialized only once when the first object of its class is

Created. a) Static b) Private c) Public d) Inline

33. The lifetime if a static member variable is some as ______.

a) The first object of its class b) The private of variables of any object

c) The public variables of any object d) Lifetime of the program.

34. 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) 1

35. Class comprises ________. a) Data members b) Members functions

c) Both (a) and (b) d) None of these

36. Private access specifiers is accessible by special function called_____.

a) Void b) inline c) Friend d) all of these.

37. Every class declaration is terminated by __. a) , b) . c) :: d) ;

38. A class belongs to which of the following data types?

a) user defined type b) Built-in type c) Derived type d) Array type.

39. A member function calling another function directly is called as___ functions.

a) Nesting b) recursive c) Friend d) Inline

40. ___ member variable are initialized only once when the first object of its class is created

a) Static b) private c) Public d) Inline

41. By default class members are treated as ________.

a) Public b) Private c) Protected d) Unprotected

42. In a class data members are also called as _______.

a) Abstracts b) Properties c) Attributes d) Dimensions

43. Declaration and functions definitions are two specifications of which of the following __.

a) Data type b) Class c) Comments d) None of these

45. The class members declared ____ can be accessed from outside the class also.

a) Private b) Public c) Protected d) Unprotected.


46. The members of a class are accessed using___.

a) New operator b) Size of operator c) Dot operator d) + operator.

47. The return type of a member function of a class 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 these. 


7. Polymorphism


1. The polymorphism means ______.

a) Single form b) Many shapes c) two forms d) Many programs

2. Polymorphism is achieved through ________.

a) Heritance b) Encapsulation c) Over loading d) Poly programming

3. The ability of a function to process the message or data in more than one form is called

as ______. a) Function overloading b) Function type c) Recursive function

d) Inline function

4. Each overloaded function must differ____. a) By the member of arguments

b) By type of arguments c) Either by number of arguments or by data types of

arguments. d) None of these

5. The mechanism of giving special meaning to an operator is called ____.

a) Operator overloading b) Function overloading c) inheritance d) Object

6. While invoking functions if the C++ compiler does not find the exact match of the function call statement then______. a) it will ignore the function call

b) generates an error c) Deletes the function d) looks for the next nearest match

7. During integral promotion, a char data type can be converted to ___

a) integer b) Float c) Double d) All the above

8. The return type of overloaded functions _______-

a) Must be same b) Must be different c) May or may not be same d) None of these

9. The functionality of operator like ‘+’ can be extended using_______

a) Operator precedence b) Operator overloading c) operator definition d) none

10. which of the following operators cannot be overloaded? a) + b) ++ c) -- d) ::

11. Operator overloading ______. a) does not overrule definition of the operator

b) Overrules original definition c) Changes original definition d) none

12. The operator function must be _______. a) Member function

b) a friend function b) Either member or friend function d)None of these

13. When overloaded operators, the overloaded operator must have______

a) All the operands of user defined type b) At least one operand of user defined type

c) All the operands of C++ Data type d) None of the given

14. A function have more than one distinct meaning is called ______ function.

a) Polymorphism b) Overloaded c) Prototype d) Parameter

15. ____ promotions are purely compiler oriented.

a) Character b) Floating point c) integral d) Constant

16. The ____ operator must have at least one operand of user defined type.

a) Existing b) Binary c) New d) Overloaded

17. Binary operators overloaded through a member function take one ___ arguments

a) Implicit b) Explicit c) Complete d) Default

18. The ____ function definitions are permitted for used defined data type.

a) friend b) Size of c) Overloaded d) Basic

19. In function overloaded do not use the __ function name for two unrelated function.

a) Same b) Different c) Similar d) Complement

20. When overloading operators, only ___ operators can be overloaded new operators

cannot be created. a) Binary b) Relevant c) Existing d) Similar

21. Which of the following is not a valid function prototype?

a) void fun(int x); b) void fun(int x,int y); c) int fun(int x) d) void fun(char x)

void fun(int y); void fun(int x,float y) void fun(float x) void fun(char x,int y)

22. The mechanism of giving special meaning to an operator is called as __ overloading

a) data b) Function c) variable c) Operator

Read the program and answer the following questions

# include <iostream.h>
# include <conio.h>

class negative
{
int i;
public :
void accept()
{
cout << “\nEnter a number ...”;
cin >> i;
}

void display()
{
cout << “\nNumber ...”<<i;
}

void operator-()

{
i = -i;
}
};

void main()
{
clrscr();

negative n1,n2;
n2.accept();
-n2;
n2.display();
getch();
}

23. The prototype of the overloaded member function is ____ 


a) negative operator-()

b) void operator minus c) void operator -() d) Void operator - (negative)

24. Which of the following statements invokes the overloaded member function?

a) Negative n1() b) --n2 c) n2+ d) -n2.

25. Identify the operator that is overloaded. a) = b) - (unary) c) - (Binary) d) negative.



8. Constructors and Destructors


1. When an instance of a class comes into scope, the function that executed is ____.

a) Destructors b) Constructors c) Inline d) Friend

2. When a class object goes out of scope, the functions that gets executed is ____.

a) Destructors b) Constructors c) Inline d) Friend

3. The name of constructor must be ____. a) same as one of the member function

b) same as class name c) same as object name d) None of these

4. Which of the following is false? 


a) Constructor and destructor have same one

b) Class and constructor have same name c) Class and destructor have same name.

d) Constructor and member function have same name

5. Which of the following do not return any value? a) member function

b) Inline function c) Friend function d) Constructor & destructor

6. Which of the following is automatically executed when an object is created?

a) member function b) Inline function c) Friend function d) Constructor & destructor

7. Which one of the following initializes a class object and allocates memory space?

a) a) Destructors b) Constructors c) Inline d) Friend

8. Which of the following is not true? a) Constructor cannot be overloaded

b) Constructor is executed automatically c) Constructor can have parameter

d) Destructor cannot be overloaded

9. Which is executed automatically when the control reaches the end of the class scope?

a) Constructor b) Destructor c) Overloading d) Copy constructor

10. Which of the following prototype can be a copy constructor of class myclass?

a) myclass(int myclass) b) int copy (myclass mc)

c) myclass copy (myclass a) d) myclass(myclass &x)

11. A copy constructor is invoked when ____ 


a) a member function returns an object

b) an object is passed as a parameter to any of the member function

c) an object is passed by reference to constructor d) all the above.

12. Which of the following is not true?

a) an object is passed as a parameter to any of the member function

b) a member function returns as object

c) an object is passed by reference to constructor d) all the above

13. Which of the following is true? a) A constructor can have parameter list

b) The constructor is executed automatically

c) The constructor function can be overloaded d) all the above

14. Which of the following is a function that removes the allocated memory of an object?

a) Constructor b) Destructor c) Member function d) Copy constructor

15. A Destructor name must be ____. a) same as one of the member function

b) same as class name prefixed by tilde(~)character c) same as object name

d) None of these

16. Which of the following cannot have arguments?

a) Constructor b) Destructor c) Function overloading d) operator overloading

17. How many constructor a class can have? a)1 b) 4 c) 6 d) Many

18. How many Destructor a class can have? a)1 b) 4 c) 6 d) Many

19. Constructor should be declared under the scope___.

a) Private b) Protected c) pointer d) Public.

20.When an object is passed by reference to constructor that is executed is ___.

a) Copy b) Static c) Default d) Inline

21. The constructor defined by the computers in the absence of user defined constructor

is ___. a) Copy b) Static c) Default d) inline

22. The special character related to destructor is ___. a) + b) ? c) ~ d) !

23. The constructors defined by the computers in the absence of user defined constructor

Is called as ____. a) Non-parameterized b) default c) compiler generated d) all of

24. The constructor without any parameter is called as ____. a) Initial constructor

b) instance constructor c) default constructor d) parameterized constructor

Read the following program and answer the following answer #include<iostream.h>

Void main( )
#include<conio.h>
{
Class simple
Clrscr ( );
{
Simple s,s1;
float x;
S1.show( );
public:
Simple s2 (7) , s3 (s1);
simple()
Simple s4 = s2,s5(4,5);
{
s = s5;
x=1.0;
s2.show ( );
}
s3.show( );
Simple(float m)
s4.show( );
{
s5.show( );
x=m;
s.show( );
}
getch( );
Simple(float a,float b)
}
{
x=a+b;
}
Simple(simple &k)
{
x = k*x;
cout<<”\n copy constructor invoked \n”;
}

Void show()
{
cout<<”\n x=” <<x<<’\n’;
}
};

25. Write prototype of non-parameterized constructor___.

26. Write prototype of parameterized constructor____.

27. Write prototype of copy constructor ____.

28. Name the private members of the class ____.

29. Identify statements that invoke copy constructor _____.

Read the following program and answer the following answer

#include<iostream.h>
#include<conio.h>
Class example
{

Int x,y;
Public:
example (example &a)
{
x = a.x;
y = a.y;
cout<<”copy constructor….”;
}
example( )
{
x = 1;
y = 1;
}
example(int a,int b)
{
x = a;
y = b;
}

Void display( )
{
cout<<”\nx=”<<x<<”and y”<<y;
}
};

void main( )
{
Clrscr( ) ;
example e1;
example e2(2,4); example e3 = e2; e1.display( );
e2.display( ); e3.display( ); getch( ); }

30. Write prototype of non parameterized constructor____.

31. Write prototype of parameterized constructor____.

32. Write prototype of copy constructor____.

33. Name private members of the class ____.

34. Name Public members of the class ____.

35. Identify statements that invoke copy constructor ____.


9. Inheritance
1. The process of creating new data types from existing data type is called……

a) Inheritance b) Polymorphism c) Overloading  
d) Encapsulation 

2. The class created from an existing base class is called …..

a) Second class b) New class c) Rich class  
d) Derived class 

3. In Inheritance, the newly created classes are …..

a) Base class b) Derived class c) Super class  
d) function 

4. In real life, children acquire the futures of their parents in adition to their own unique features. Which of the following terms refers this?

a) Encapsulation b) polymorphism c) overloading d) inheritance

5. Reusability of code, code sharing, consistency of interface are all advantages of……

a) inheritance b) polymorphism c) overloading d) Encapsulation

6. Which is the following is true?

a) Base class inheritance properties from derived class

b) Derived class class inheritance properties from base class

c) Derived class does not inherit any properties from base class

d) both a and b are true

7. Which of the following derives a new class “sub_class” from the base class “main_class”?

a) class main_class: public sub_class b) class sub_class; public main_class

c) class main_class: class sub_class d) class sub_class: public main_class

8. What is wrong with the following statement that derives a B_class from A_class?

Class B_class; public A_class

a) Semicolon (;) must be replaced by colon (;)

b) Semicolon (;) must be appear at end of the statement

c) The world public must be replaced by private

d) The world public must be replaced by protected

9. Class xclass: public yclass from the above statement which of the following is true?

a) xclass is the base class b) yclass is the base class

c) yclass is derived from xclass d) yclass is the derived class

10. Private, public and protected are all ……….

a) C++ variables b) Control structures of C++

c) Access Specifiers d) Derived class members

11. The default visibility mode while inheriting members of a base class is…….

a) private b) protected c) public d) extended public

12. Which of the following is true with respect to inheritance?

a) Private members of base class are inherited to drived class with private

accessibility

b) Private members of base class are not inherited to drived class with private

accessibility

c) Public members of base class are inherited but not visible to derived class

d) none of the given

13. In inheritance, protected members of base class are inherited as….. when private access

specifier is used

a) private members b) protected members c) public members d) not inherited at all

14. When a class is derived by private access specifier, the bublic members of base class are

inhirited as ………… of derived class

a) private members b) protected members c) public members d) none

15. When a class is derived by protected access specifier, the public and protected members

of base class are inherited as ……… of drived class

a) private members b) public members c) protected members d) none

16. When a class derived by access specifier protected, the public members of base class are

inherited as …….. of derived class

a) private members b) protected members c) public members d) none

17. When a class derived by access specifier public, the protected members of base class are

inherited as …….. of derived class

a) private members b) protected members c) public members d) none

18. When a class is inherited by public visibility mode the public members of base class are

derived as ………. Derived class

a) private members b) protected members c) public members d) none

19. Single, multiple, multilevel, hybrid and hierarchical are all types of…..

a) Polymorphism b) Inheritance c) Encapsulation d) overloading

20. When a sub class inherits only from one base class it is known as……

a) single inheritance b) double inheritance c) hierarchical inheritance d) none

21. The symbol that must be used between derived and base class is…….

a) & b) : c) :: d) #

22. A derived class that inherits from multiple base class is known as……..

a) single inheritance b) multiple inheritance

c) multilevel inheritance d) hybrid inheritance

23.Classes used for only deriving other classes are called…..

a) public classes b) abstract class c) derived class d) objects

24. The class from which the other classes are derived is called….

a) objects b) object class c) sub-class d) function

25. Which is not inherited from base class?

a) object b) function c) constructor d) data member


Read the following program and answer the following answer

class vehicle

{
int wheels;
public:
void inputdata( int, int);
void outputdata();
protected :
int passenger;
};
class heavy_vehicle : protected vehicle
{
int diesel_petrol;
protected:
int load;
Public:
void readdata( int, int); void writedata();
};

class bus: private _heavy_vehicle

{
};
char marks[20];

public:
void fetchdata( char ); void displaydata();

26. Which is the base class of the class heavy_vehicle?

a) bus b) heavy_vehicle c) vehicle d) both a and c

27. The data member that can be accessed from the function display data () is ……

a) passenger b) load c) marks d) all of these

28. The data member that can be accessed by an object of bus class is……

a) input data b) read data output data write data  
display data 

c) fetchdata d) all of these

29. Name the derived class of the class heavy_vehicle________

30. Name the data members that can be accessed from the function displaydata() _________

31. Is the member function output data accessible to the objects of heavy_vehicle class _______.



10. IMPACT OF COMPUTERS ON SOCIETY

1. The technical elements we need to reach out the benefits if IT to the common man are _.

a) Connectivity b) Affordable computers c) Software d) All of these

2. 85% of computer usage is ___. a) Word processing b) Graphics c) Animation d) None.

3. Which of the has changed our life style? a) Browsing b) e-mail c) chat d) All of these

4. Which of the following enables data storage and management?

a) LCD screen b) Picture phone c) Archinve unit d) Speakers

5. The purpose of personal archives is ____.

a) LCD screen b) picture phone c) Archive unit d) Speakers

6. In a computerized homes,Which of the following rooms have LCD screen,archive

unit,personal archives,emotional containers etc?

(a)living room (b) kids room (c) home office (d) bed room

7. Whichprevents people from acquiring bad habits?

(a) archive unit (b)emotion containers (c) camera (d) speakers

8………….. are mounted on the wall to provide better effect and save floor space.

(a)LCD SCREEN (B)camera (c)speakers (d) all the given

9………..is a picture based personal telephone directory. (a) picture phone and pad

(b) personal archives (c)emotional container (d)archive unit

10…………. Features allows to sing alone with audio coming from orginal source.

(a)kara-oke (b)memo frame (c)projection TV (d)interactive table cloth

11…………… can function as electronic pets.

(a) archive units (b)memo pads (c)ceramic audio (d)robots

12.kara-oke,electronic pets,games over net are all part of which of the following rooms in

a coputerised home………….

(a)LIVING ROOM (B) KIDS ROOM (C)HOME OFFICE D) dinnig room

13.animated stories package,memo frame,Bookshelf,personal creativity tool are all

located in which of the following places of a computerized home….

a) kids room b)Bed room c)home office d) dinning room

14…………. Means easy interaction with other people through touch screen,scanner and

microphone facilities.

a) memo frame b)bookshelf c)Archive units d) kara-oke

15. In a computeraised home,………….has touch and voice control for various

appliances,projection TV,Alaram clock,moving telephone ete.

a) kids room b) bed room c) home office d)dinning room

16. in which of the following rooms mirrors,medical box and special speakers are located

of a computerized home?...

a)kitchen b)bed room c)bath room d)kids room

17. speakers,intelligent aprons,food analyzer,health monitor are found in……..of a

computerized home.

a)kitchen b)bed room c)bath room d)kids room

18. interactive table cloth keeps the food………………

a)hot b)cool c)sufficiently warm d)packed

19. interactive table cloth and ceramic audio player are found in ……….. of a

computerized home…………..

a)kitchen b)bed room c)bath room d)dinning room

20……………..enable us to withdraw money from our accounts in a particular bank

anytime and any where.

a)ATM b)archives c)picture phone and pad d)memo frame

21…….permits banking from the comfort of the home by using internet facilities.

a)ATM b)e-Banking c)memo frame d)none of the given

22. through……..we can purchase any prodect,any brand,any quality from any where.

a)ATM b)e-banking c)e-shoping d)e-governance

23. CBT stands for….. a)computer based tutorials b)computer based teaching

c)common basic techniques d)control bullet in table

24. ATMis example for……..

a)e-shoping b) e-banking c)transcription d)digitization

25………….enable online educational programs leading to degrees and certifications.

a)e-shopping b)e-banking c) e-commerce d)e-learning

26 ……….facilitates remote diagnostics.

a) ATM b) e-learning c) internet d)none of given



11. IT ENABLED SERVICES

1. ITES means ________. a) Improving technology enlighting services

b) Inforamtion techonology enabled services

c) Information techonology extended services d) Information entrusted systems

2. Which of the following is an IT enabled service?

a) E-Governence b) Word processer c) Spreadsheet d) database

3. Which of the following is not an IT enabled service?

a) Callcentres b) E-Govenence c) Data digitization d) Word processer

4. A facility that allows the user to speak into a special device while typing a letter using

Computer is called ________.a) Cell phone b) Telephone c) Dictaphone d) Speaker

5. Which of the following is sometimes defined as a telephone base shared services?

a) Data digitization b) Call centre c) Data management d) Bar code recongnition

6. Collection digitization and processing of data is basic function of __________.

a) Call centre b) Data management c) E-Governance d) Data collection

7. Which of the following is not an ITES of data manadement category? a) Data entry

b) Custom reports c) Character regonition and processing d) Transcription

8. Which of the organization can potentially benefit from ITES?

a) Banking b) Insurance c) Legal d) All the above

9. ___ is a permanent legal document that formally states the result of a medical

investigation. 


a) Medical transcription b) Medical prescription


c) Medical document d) Medical anatomy

10. ____ refers to conversion of non - digital material to digital form.

a) Transcription b) Data transfer c) Data digitization d) Noen of the given

11. Long term preservation storage of important documents easy to use and access of

information are all benefits of _________. a) Medical transcription b) Call centre

c) data digitization d) Web based services

12. Career guidance employment online examnation results online are all ______.

a) Web based service b) Data processing service c) Call centre service

d) Transcription

13. BPO may be expanded as ______


 a) business product outcome b) Business process 

outcome c) Business product outsourcing d) business process outsourcing



12. COMPUTER ETHICS

1. Computer ethics has its riits in the work of ____ during world war II.

a) Charles babbage b) Blaise bascal c) Norbert wiener d) Herman horllerith

2. Who amoung the following began to examine unethical and illegal uses of computers

By computer professionala in mid 1960s in Menlo park, California?_____.

a) Charles babbage b) Blaise bascal c) Norbert wiener d) Herman horllerith

3. ____ is a set of rules for determining moral standards or socially acceptable bahaviour

a) Standard b) Ethics c) protocol d) None of the given

4. General guidelines of computer ethics are needed for ___.

a) Protection of personal data b) Computer crime c) Cracking d) All the above

5. The protection of hardware facilities magnetic disks and other illegal accessed stolen

Damaged or destroyed items refers to _____ security.

a) Physical b) Personal c) personnel d) none of the given

6. ____ security refers to software setups that permit only anthorzied access to the system

a) Physical b) Personal c) personnel d) none of the given

7. ___ security refers to protecting data and computer system against dishonesty or

Negligence of employess. a) Physical b) Personal c) personnel d) none of the given

8. “Cracking” comes under ____.

a) Data security b) Computer crime c) Website service d) Transcription

9. Making and using duplicate hardware and software is called ____.

a) Copy right b) Free copy c) piracy d) none of the given

10. ___ is a self-replicating program that can cause damage to data and files stored on

Your computer. a) Piracy b) Freeware c) Virus d) none of the given

11. Running other software for the idel computer without the knowlwdge of the organization

Is called theft of _______. a) Computer crime b) Use c) Computer d) software

12. ___ is the illegal access to the network or computer system.

a) Piracy b) Virus c) Cracking d) Security


13. Which of the following is not a way of protection? a) Physical Security

b) Personal Security c) personnel Security d) Piracy

No comments:

Post a Comment