compqb1

Embed Size (px)

Citation preview

  • 7/29/2019 compqb1

    1/23

    1. OBJECT ORIENTED CONCEPTS USING C++

    PART A

    1. The solutions to the problems are in the form of a) programs b) application c) programs or application software d) software or hardware2. A computer . operates on a set of known input data itemsa) program b) application c) hardware d) software3. The .. transforms the input data into a set of expected data items.a) program b) software c) hardware d) application

    4. .. categorized the input data items.a) variables b) constants c) operators d) data types5. It was realized that viewing the solution of a problem as .. separate segments does not

    resemble the way human beings solve the real life problemsa) two b) four c) six d) eight6. is an example of object oriented programming languagea) pascal b) BASIC c) C d) C++7. programming facilitates the way of problem solving by combining data and operations that

    are to be performed on the data.a) basic b) structured c) object-oriented d) procedural8. The .. represent the behavior of an object

    a) variables b) data c) expressions d) operations9. The data type conventionally represents an object in the real world.a) data b) class c) variables d) declaration10. increases the functionality of a derived class and also promotes reusability of code.a) class b) functions c) polymorphism d) inheritance11 .. data type allows programs to organize as objects that contain both data and functionsa) user defined b) class c) static d) built-in12. .. provides security to data, as unrelated member functions cannot access its dataa) class b) inheritance c) polymorphism d) data hiding or abstraction13. .. reduces software complexity as multiple definitions are permitted to an operator or functiona) polymorphism b) inheritance c) data hiding d) abstraction

    14. allows a class to be derived from an existing class thus promoting the reusability of codea) polymorphism b) inheritance c) data hiding d) abstraction15. communicate with one another by sending data as inputs.a) class b) objects c) variables d) constants

    PART B

    1. Define object.2. Define encapsulation3. Define polymorphism4. Define inheritance5. What is a class ?

    6. What is abstraction ?7. What is the significance of an object ?8. Differentiate polymorphism and inheritance

    PART C

    1. Explain inheritance with example2. Explain encapsulation with example3. Explain polymorphism with example4. Enumerate the advantages of object oriented programming

  • 7/29/2019 compqb1

    2/23

    2. OVERVIEW OF C++

    PART A

    1. C++ was developed at AT & T laboratories in the early 1980s by ..a) Dennis Ritchie b) Rick Mascitti c) Bjarne Stroustrup d) Dan Bricklin2. The name C++ was coined by a) Dennis Ritchie b) Rick Mascitti c) Bjarne Stroustrup d) Dan Bricklin3. The basic types are collectively called as

    a) variables b) statements c) constants d) tokens4. A . is the smallest individual unit in a programa) variables b) statements c) constants d) tokens5. . have special meaning to the language compiler.a) identifiers b) constants c) keywords d) operators6. .. cannot be used as normal identifiers.a) keywords b) variables c) constants d) punctuators7. Identifiers are also called as a) keywords b) variables c) punctuators d) operators8. . are memory boxes that hold values or constantsa) punctuators b) variables c) keywords d) operators

    9. A variable name must begin with a a) alphabet b) underscore c) alphabet or underscore d) numbers or alphabets10. . are data items whose values cannot be changeda) variables b) constants c) operators d) keywords11. constant must have at least one digit and must not contain any fractional parta) float b) integer c) char d) string12. A sequence of digits starting with 0 (zero) is treated as .. constant.a) octal b) hexadecimal c) decimal d) integer 13. A sequence of digits starting with 0x is treated as integera) octal b) hexadecimal c) decimal d) integer 14. . is a signed real number.

    a) integer b) signed integer c) character d) floating point15. The letter . is used to represent the floating- point constant exponent form.a) L or l b) E or e c) U or u d) F or f 16. . constant is a constant that contains a single character enclosed within single quotes.a) character b) string c) integer d) real17. .. is a sequence of characters surrounded by double quotes.a) character b) string c) integer d) real18. Each string literal is by default added with a special character . which marks the end of a string.a) \n b) \o c) \ d)19. .. specifies an operation to be performed that yields a value.a) keyword b) operator c) punctuator d) identifier

    20. operator require one operanda) relational b) unary c) binary d) ternary21. operator requires two operandsa) relational b) unary c) binary d) ternary22. operator requires three operandsa) relational b) unary c) binary d) ternary23. are executed in the order of precedence.a) keywords b) statements c) operators d) functions24. The logical way of grouping of the operands and the operators for evaluation is called .a) expression b) association c) order of precedence d) statements

  • 7/29/2019 compqb1

    3/23

    25. .. operators are used to compare values.a) assignment b) relational c) logical d) arithmetic26. A . is constructed using any two operands connected by a relational operatora) expression b) relational expression c) logical expression d) arithmetic27. Relational operators have .. precedence than the arithmetic operators.a) higher b) lower c) equal d) unique28. .. operators combines the results of one or more conditions.a) assignment b) logical c) relational d) unary29. The logical operators have precedence to relational and arithmetic operators.

    a) higher b) lower c) equal d) unique30. A operator is also called as conditional operator.a) unary b) binary c) ternary d) relational31. is the simple assignment operator.a) * b) - c) = d) +32. are characters with a specific function.a) punctuators b) keywords c) identifiers d) constants33. are the kind of data that variables hold in a programming languagea) keywords b) identifiers c) data types d) punctuators34. .. allow users to define variables that would represent an existing data type.a) type def b) scalar c) enumerated d) derived

    35. .. data type helps users in creating a list of identifiers.a) type def b) scalar c) enumerated d) derived36. .. is a qualifier that can be added to variable declarationa) data type b) storage class c) variable name d) constant name37. .. variables are not initialized with appropriate values based on their data type.a) register b) extern c) auto d) static38. Auto variables get undefined values known as ..a) junk character b) garbage c) default values d) none39. data types are also called as fundamental or basic data types.a) integral b) user defined c) derived d) built-in40. Integral, float and void are the three .. data types

    a) fundamental b) derived c) user defined d) floating41. . is a data type that can hold both the character data and the integer dataa) int b) string c) char d) float42. .. can store values with fractional part.a) long b) short int c) int d) float43. .. type indicate that a function does not return a valuea) void b) int c) float d) char 44. are built from the basic integer and floating type or user defined data typesa) integral type b) derived type c) built-in type d) user defined type45. Each element is accessed using the of the element in the arraya) beginning b) number c) positional value d) b or c

    46. The numbering of the elements in an array commences from a) -1 b) 1 c) 0 d) b or c47. The .. indicates that it holds nothing.a) int b) void c) return d) function48. A .. is a variable that holds a memory address.a) functions b) integer c) variables d) pointers49. Every byte in the computers memory has a) space b) address c) values d) allocation50. When a program is compiled, some .. is allocated to the variables by the compiler.a) memory b) value c) constants d) statement

  • 7/29/2019 compqb1

    4/23

    51. When we use & operator, the C++ compiler . in the memory to hold the valuesa) reserves space b) associates c) stores d) accesses52. The asterix * operator is used to declare a . variablea) pointer b) integer c) constant d) float53. The operator is used to display the contents stored at a locationa) + b) & c) * d) /54. is a unary operator a) + b) - c) * d) /33. The name assigned to a data field that can assume any of a given set of values is defined as thea) variables b) constants c) keywords d) modifiers

    34. . are user defined name entities of memory locations that can store data.a) variables b) constants c) keywords d) modifiers35. names must begin with a letter or underscore.a) variable b) constant c) keywords d) modifiers36. are allocated memory to store data.a) functions b) integer c) variables d) pointers37. Every variable should be separated by . when more than one variable of the same data type

    is declared in a single declaration statement. a) ; b) , c) = d) /38. . values are stored in 16 bit format in binary form.a) float b) char c) integer d) double39. Maximum value stored in an integer variable is .. and the minimum value is ..

    a) -32768 , 32767 b) 32767 , 32768 c) 32728 , +32727 d) 32728, 3272940. The . bit is also called as the most significant bit or sign bit.a) 16th b) 8th c) first d) last41. The 16th bit will have the value 1 if a . value is storeda) negative b) positive c) integer d) float42. When the modifier . is used the integer data type will store only positive numbers.a) short int b) signed c) unsigned d) long int43. The range of unsigned integers goes upto .a) 216 b) 28 c) 24 d) 232

    44. The maximum value stored in an unsigned integer is ..a) 255 b) 65535 c) 32768 d) 3.4e+10

    45. The . alters the base data type to yield new data typea) modifier b) typedef c) enum d) extern46. . modifies the range of the integer values as the sign bit is also used to store data.a) short int b) signed c) unsigned d) long int47. . increases the bytes for a particular data type thus increasing the range of values.a) short int b) int c) long int d) float48. The base data type should be prefixed with the modifier at the time of .. a variable.a) using b) initializing c) referring d) declaring49. The . qualifier specifies that the value of a variable will not change during the run timeof a program. a) extern b) auto c) const d) variable50. Any attempt to alter the . defined with this qualifier will throw an error message by the

    compiler. a) extern b) auto c) const d) variable51. refers to data type changes brought about in the expressions by the compiler.a) implicit conversion b) variables c) constants d) auto52. .. variables are sensitive to the data type they point to.a) static b) extern c) pointer d) register 53. .. is achieved by prefixing the variable or value with the required data type.a) typedef b) type cast c) enum d) storage class

  • 7/29/2019 compqb1

    5/23

    PART B

    1. Give a brief history of C++2. Define tokens3. Define keywords4. Define identifiers5. Define constants6. What are escape sequences ?7. What is a string literal ?

    8. What is an operator ?9. List the types of operators.10. Write short notes on conditional operator.11. Why is the data grouped into different categories ?12. How will you classify the data types of C++ ?13. Write the syntax of typedef statement.14. Write the syntax of enum statement.15. What are storage classes ?16. What are the purposes of a void type ?17. What is a pointer ?18. What is the use of & operator ?

    19. What is the use of * operator ?20. Define variables21. State the rules to be followed while naming a variable.22. Write the syntax of variable declaration.23. List the qualifiers or modifiers that can be used with variable names24. How will you declare pointer variables ?25. What is the use of sizeof operator ?26. How will you initialize a pointer variable ?27. Define type cast.

    PART C

    1. Explain constants with example.2. Explain operators with example.3. Tabulate the complete operator precedence of all operators used in C++.4. List the punctuators used in C++.5. Give the broader classification of C++ data types.6. Explain enumerated data type with example.7. Explain user defined type with example.8. Describe storage classes.9. What are built in data types ? Explain.10. Explain the use of pointers in c++11. What is type cast ? Explain.

    3. BASIC STATEMENTS

    PART A

    1. . statements such as reading data, processing data and displaying information are theessential functions of any computer program.

    a) declaration b) input/output c) assignment d) return2. There are methods for assigning data to the variables.a) two b) four c) three d) seven3. Data is read from the keyboard during runtime by using the object .a) input b) read c) inc d) cin

  • 7/29/2019 compqb1

    6/23

    4. is a predefined object that corresponds to a standard input stream.a) cin b) input c) inc d) read5. .. represents the flow of data from the standard input device the keyboarda) output stream b) instream c) input stream d) stream input6. The declarations for the object cin are available in a header file called a) istream.h b) instream.h c) iostream.h d) streamin.h7. file comprises the combined properties of istream and ostream.a) streamio.h b) instream.h c) iostream.h d) oistream.h8. A . file comprises of all standard declarations and definitions for predefined functions.

    a) program file b) header file c) application file d) document file9. One can include the header file in the program by using a .a) input/output b) function call c) return d) preprocessor directive10. A preprocessor directive starts with .a) $ b) # c) < d) @11. .. is a typical preprocessor directive, that instructs the compiler to include the header file

    iostream.ha) include b) main() c) getch() d) reference12. The . is the extraction or get from operator.a) >> b) 14. Multiple values can be read from the input stream and placed in the corresponding variables, by

    the extraction operator.a) including b) copying c) pasting d) cascading15. is a predefined object of standard output stream.a) cin b) cout c) outc d) coutput16. The is called the insertion operator or put to operator.a) >> b) # c) c) >>= d)

  • 7/29/2019 compqb1

    7/23

    26. Each else matches with the nearest unmatched preceding a) if b) if..else c) braces d) semicolon27. . is a multiple branching statement.a) switch b) if c) for d) do28. Every action block should be terminated with a .. statement.a) continue b) for c) break d) case29. . execute a set of instructions repeatedly for a certain number of times.a) control structure b) continue c) conditions d) loops30. A looping block consists of . Segments

    a) three b) two c) four d) six31. A looping process .. the condition variable when the control enters the loop for the first time.a) executes b) initializes c) increments d) tests32. A looping process . the segment of the bodya) executes b) initializes c) increments d) tests33. A looping process . value of the condition variable as requireda) executes b) initializes c) increments d) tests34. A looping process .. the condition variable in the form of a relational expression.a) executes b) initializes c) increments d) tests35. There are kinds of loops in C++.a) two b) three c) four d) many

    36. do. while is called as ..a) exit check loop b) entry check loop c) no exit loop d) no entry loop37. The control exits the loop once the test expression is evaluated to ..a) true b) false c) 0 d) 138. .. is an entry controlled loop and is used when an action is to be repeated for a predetermined

    number of times.a) if b) for c) do d) while39. . is executed only once when the loop is executed for the first time.a) declaration b) statements c) definition d) initialization40. is evaluated before the commencement of every iteration.a) declaration b) test c) definition d) statement

    41. .. segment is executed before the commencement of new iteration.a) condition b) initialisation c) declaration d) increment42. Each segment in the for loop can comprise a set of instructions, each instruction should be separated

    by a operator.a) semi colon b) colon c) braces d) comma43. The .. statement forces the next iteration of the loop to take place, skipping any code following

    it.a) continue b) break c) switch d) while44. . statement would exit the current loop only.a) continue b) break c) switch d) while45. The machine readable form of a program called as .

    a) object file b) source file c) binary form d) executable form46. create object files from source code.a) compiler b) translator c) Machine d) program47. .. are translator programs that create a machine-readable program from the source code.a) compilers b) translator c) machines d) software

    PART B

    1. Name the different statements in C++ constructed using tokens.2. Define iostream.h

  • 7/29/2019 compqb1

    8/23

    3. What are the essential functions of a computer program ?4. Define cin.5. What are the sections of C++ program ?6. What are the methods for assigning data to the variable ?7. Define cascading of extraction and insertion operator.8. What are the two major category of control structures ?9. Write the syntax of if statement.10. Write a C++ program to find whether the given number is even or odd.11. What is the use of break statement ?

    12. What is the use of continue statement ?13. Define loops.14. What are the different kinds of loops in C++ ?15. Give the syntax of for statement.16. What are the rules for the formation of nested loops ?17. Give the importance of declaration statement.

    PART C

    1. Explain the use of header file.2. Explain nested if statement with example.

    3. Explain switch. Case statement with example.4. Answer the following questions based on the program# include # include void main(){

    clrscr();int num = 2;do{

    cout

  • 7/29/2019 compqb1

    9/23

    ctr+ = 1;}

    cout

  • 7/29/2019 compqb1

    10/23

    11. The . may include a set of actual parameters, enclosed in parentheses separated bycommas.

    a) function type b) function prototype c) function name d) template12. Parameters associated with call statement is called .a) actual b) formal c) dummy d) function13. Parameters associated with function header is called ..a) function b) actual c) formal d) arguments14. In .. method, the called function creates new variables to store the value of the arguments

    passed to it.

    a) call by variable b) call by value c) call by reference d) call by function15. .. method copies the values of actual parameters into the formal parameters.a) call by variable b) call by value c) call by reference d) call by function16. In method, the flow of data is always from the call statement to the function definition.a) call by variable b) call by value c) call by reference d) call by function17. In method, any change in the formal parameter is not reflected back to the actual parameter.a) call by variable b) call by value c) call by reference d) call by function18. In .. method, the called function arguments formal parameter become alias to the actual

    parameters in the calling function.a) call by variable b) call by value c) call by reference d) call by function19. In .. method, the function is actually working on the original data.

    a) call by variable b) call by value c) call by reference d) call by function20. In method, any change in the formal parameter is reflected back to the actual parameter.a) call by variable b) call by value c) call by reference d) call by function21. The actual parameters can be passed in the form of constants or variables or expressions to the formal

    parameters which are of type.a) integer b) float c) value d) reference22. The actual parameters can be passed only as variables to formal parameters of type.a) integer b) float c) value d) reference23. We cannot have a value for an argument in between the argument list.a) default b) integer c) float d) reference24. The data type of a function is treated as .. , if no data type is explicitly mentioned.

    a) int b) char c) float d) double25. functions execute faster but require more memory space.a) linein b) void c) main d) inline26. functions are used when the functions are small.a) linein b) void c) main d) inline27. keyword is just a request to the compiler.a) linein b) void c) main d) inline28. refers to the accessibility of a variable.a) scope b) stack c) storage classes d) functions29. A .. variable is defined within a block.a) local b) function c) file d) class

    30. The scope of a .. variable is the block in which it is defined.a) local b) function c) file d) class31. A . variable cannot be accessed from outside the block of its declaration.a) local b) function c) file d) class32. A block of code begins and ends with .a) < > b) { } c) ( ) d) [ ]33. A . variable is created upon entry into its block and destroyed upon exit.a) local b) function c) file d) class34. The scope of a . variables declared within a function is extended to the function block, and all

    sub- blocks therein.

  • 7/29/2019 compqb1

    11/23

    a) local b) function c) file d) class35. The life time of a . Scope variable, is the life time of the function block.a) local b) function c) file d) class36. The scope of formal parameters is . Scope.a) local b) function c) file d) class37. A variable declared above all blocks and functions has the scope of a .a) local b) function c) file d) class38. The life time of a scope variable is the life time of a program.a) local b) function c) file d) class

    39. The operator reveals the hidden scope of a variable.a) assignment b) binary c) relational d) scope

    PART B

    1. Define function.2. What are the advantages of using a function ?3. What is the use of return statement ?4. List the information provided by function prototype to the compiler.5. Give the syntax of a function prototype.6. What is the main purpose of function prototype ?

    7. How can a function be invoked from another function ?8. Define parameters.9. What are the two methods of invoking a function in C++ ?10. Define actual and formal parameters.11. Differentiate call by value and call by reference.12. List the rules for actual parameters.13. Define void.14. What are the points to be noted while assigning default values to the parameters ?15. Define function scope.16. Define file scope.17. What is the use of scope resolution operator ?

    PART C

    1. Explain the working of a function with example.2. Explain call by value with an example.3. Explain call by reference with an example.4. Explain inline functions with an example.5. Explain local scope with an example.6. Explain function scope with an example.7. Explain file scope with an example.8. Explain scope operator with an example.

    9. What will be the output of the following program ?#include # includevoid print ( int times, char ch = *){

    cout

  • 7/29/2019 compqb1

    12/23

    {clrscr();print(50);print(A, 97);print();

    }

    5. STRUCTURED DATA TYPE ARRAYS

    PART A

    1. An in C++ is a derived data type that can hold several values of the same type.a) int b) float c) array d) char 2. An array is a collection of . of the same type that are referenced by a common name.a) data types b) variables c) constants d) keywords3. Arrays are of typesa) 3 b) 4 c) 6 d) 24. Arranging the data in given array either in ascending or descending order is called .a) merging b) searching c) sorting d) filtering5. . are otherwise called as literals, which are treated as single dimension array of characters.

    a) integer b) float c) double d) string6. A character array should be terminated with a . character.a) \0 b) \a c) \n d) \t7. The instance cin, treats white space or carriage return as . for string.a) beginner b) terminator c) symbol d) character 8. gets() is available in .a) stdio.h b) iostream.h c) istream.h d) ostream.h9. getline() is a member function of standard .. stream.a) stdio.h b) iostream.h c) istream.h d) ostream.h10. . is a member function of standard output stream.a) gets() b) getline() c) cin d) write()

    11. All member functions of a class, should be accessed through a of class.a) variable b) constant c) object d) literals12. The two parameters required for .. function are identifier string characters, and number of

    characters to be displayed.a) gets() b) getline() c) cin d) write()13. .. function returns the number of characters stored in the array.a) strlen() b) strcpy() c) strcmp() d) length()14. function copies source string to target string.a) strlen() b) strcpy() c) strcmp() d) length()15. .. function compares the two given strings.a) strlen() b) strcpy() c) strcmp() d) length()

    16. A array is an array in which each element is itself an array.a) 1 - D b) 2 - D c) 3 - D d) 5 - D17. The elements in a array is stored either row-wise manner or column-wise mannera) 1 - D b) 2 - D c) 3 - D d) 5 - D18. The size of . dimension is optional in array initialization.a) first b) second c) any d) third19. Array parameters by default behave like a .. parameter.a) reference b) value c) function d) method20. The C++ compiler will automatically attach even if we omit in a string literala) \0 b) \a c) \n d) \t

  • 7/29/2019 compqb1

    13/23

    PART B

    1. Define array.2. List the types of an array.3. How can we access the element of an array ?

    4. Give the syntax of gets() function5. Give the syntax of getline() function6. What are the methods to display the contents of character array ?7. Write short notes on write() function.8. List the points to be noted while using two dimensional array.9. Write the syntax of declaring a two dimensional array.10. How can we calculate the size of a 2-D array ?11. How can we pass arrays as arguments to functions ?12. Define matrix.13. Write notes on array of strings.14. What is the use of null character in a string ?

    15. Write the function of the following statementsa) num[3]++; b) num[++a] = 10;

    PART C

    1. Explain single dimensional array with an example.2. What will be the output of the following program ?# include# include void main(){

    int vector[]= {2,4,8,10,0};for (int i = 4; i>2; i--)vector[i]= vector[i-1];

    clrscr();cout

  • 7/29/2019 compqb1

    14/23

    6. CLASSES AND OBJECTS

    PART I

    1. The most important feature of C++ is .a) Function b) Array c) pointer d) class2. Bjarne Stroustrup initially gave the name . for C++a) C b) C with objects c) C with classes d) C with functions3. A .. is a new way of creating and implementing a user defined data typea) class b) array c) function d) derived data type4. The functions are also called as .

    a) attributes b) arrays c) methods d) access specifiers5. A class specification has .. parts.a) two b) three c) four d) five6. The body of a class is enclosed within .a) ( ) b) < > c) { } d) [ ]7. The body of a class is terminated by a a) , b) : c) ; d) }8.The .. body contain the declaration of variables and functionsa) function b) class c) array d) methods9. The class body has access specifiersa) two b) three c) four d) six10. Specifying visibility label is optional.

    a) private b) public c) protected d) a or b11. By default the members will be treated as . if a visibility label is not mentioned.a) private b) public c) protected d) a or b12. The members that have been declared as can be accessed only from within the classa) private b) public c) protected d) a or b13. The members that have been declared as can be accessed from the inherited class too.a) private b) public c) protected d) a or b14. The members that have been declared as .. can be accessed from outside the class also.a) private b) public c) protected d) a or b15. Instruments allowing only selected access of components to objects and to members of other classes iscalled as

    a) polymorphism b) inheritance c) encapsulation d) data abstraction16. Data abstraction is achieved through .a) polymorphism b) inheritance c) encapsulation d) data hiding17. .. is the key feature of object oriented programminga) data abstraction b) data hiding c) data types d) classes18. Certain special functions called . can also be able to access the private membersa) data members b) member functions c) friend functions d) virtual functions19. Members of the class are further classified into ..a) two b) three c) four d) six20. .. are the data variables that represent the features or properties of a class.a) data members b) member functions c) pointer arithmetic d) array declaration

    21. are the functions that perform specific tasks in a class.a) data members b) array declaration c) class name d) member functions22. Member functions are called as a) data types b) access specifiers c) methods d) attributes23. Data members are also called as ..a) data types b) access specifiers c) methods d) attributes24. In C++ the class variables are known as .a) functions b) methods c) objects d) pointers25. . can also created by placing their names immediately after the closing brace of the classdeclaration. a) class b) objects c) operator d) function

  • 7/29/2019 compqb1

    15/23

    26. The members of the class are accessed using the operator.a) dot b) comma c) semi colon d) paranthesis27. A member function can call another member function directly, without using the operator.a) dot b) comma c) semi colon d) paranthesis28. .. can also be passed as arguments.a) objects b) class c) functions d) operators29. The member variable is initialized to zero, only when the first object of its class is created.a) integer b) float c) char d) static30. The .. variable is shared by all the other objects of its class type.

    a) integer b) float c) char d) static31. The scope of the .. variable is within the class but its lifetime is the lifetime of the program.a) integer b) float c) char d) static32. The members defined within the class behave like .a) arrays b) structures c) inline functions d) user defined functions

    PART II

    1. Define class.2. What are the two parts of a class

    specification ?3. Write the general form of class declaration.4. What are the access specifiers that can be

    used in the class ?5. Define data hiding.6. Define data abstraction.7. Write short notes on members of a class.

    8. Differentiate data members and memberfunctions.

    9. Define objects.10. Write the syntax of the statement used to

    access a member function of a class.

    11. What is the significance of static membervariable ?12. Give example for arrays of objects.

    PART III

    1. Write a C++ program using class with functions for adding two numbers.2. Explain the procedure of defining methods of a class.3. Illustrate the memory allocation for objects with example4. List the points to be noted while declaring a class.5. What are the special characteristics of the member function that are used in the program development ?6. Demonstrate the use of static member variable declaration with example.

    7. Identify the errors :#include class simple{

    int num1, num2, sum = 0;protected :

    accept(){

    cin>> num1>> num2;}

    public :

    display(){sum = num1 + num2;

    }};void main(){ simple s;

    s. num1 = s.num2 = 0;s. accept();display(); }

  • 7/29/2019 compqb1

    16/23

    7.POLYMORPHISM

    PART I

    1. The word polymorphism means a) many functions b) many pointers c) many shapes d) many types2. Polymorphism is achieved in ways.a) 2 b) 3 c) 4 d) many3. The term . means a name having two or more distinct meaningsa) overriding b) encapsulation c) inheritance d) overloading4. .. is one of the facets of C++ that supports object oriented programming

    a) method overloading b) function overloading c) object overloading d) oriented overloading5. . strategy is adopted by the compiler when functions invoked in function overloading.a) best b) match c) match best d) best match6. overloading gives additional functionality to the c++ operators.a) operator b) method c) function d) constructor 7. The functionality of + operator can be extended to strings using . overloading.a) method b) operator c) constructor d) function8. operator can be overloaded by C++.a) membership b) scope resolution c) sizeof d) unary9. operator cannot be overloaded by C++.a) membership b) scope resolution c) sizeof d) all of these

    10. . is a membership operator.a) . b) , c) ; d) :11. Operator functions must be .. functions.a) member b) friend c) a or b d) member or user defined12. Which of the following is used to declare the operator function ?a) function ( ) b) operator ( ) c) method ( ) d) void ( )13. The mechanism of giving special meaning to an operator is called .. overloading.a) function b) method c) constructor d) operator 14. operators overloaded through a member function take one explicit argument.a) unary b) binary c) ternary d) assignment15. How many explicit argument taken by binary operators overloading through a member function

    a) 1 b) 2 c) 3 d) 615. . overloading must have at least one operand of user-defined type ?a) operator b) function c) method d) constructor 16. The overloaded operator must have at least operand of user defined type.a) 6 b) 2 c) 3 d) 1

    PART II

    1. Define polymorphism.2. Define overloading.3. How is polymorphism achieved in C++ ?4. Define function overloading.

    5. How are functions invoked in function overloading ?6. Why the following is invalid prototype ? Give reason.Void fun(int x);Void fun(int y);7. Write a note on integral promotions in C++.8. What are the rules for function overloading ?9. Define operator overloading .10. How can you achieve concatenation of character arrays using + operator in C++ ?11. List the steps involved to define an overloaded operator.12. List the operators that cannot be overloaded.

  • 7/29/2019 compqb1

    17/23

    PART III

    1. Write a program in C++ to do the following tasks using function overloading.a) find the area of a circle b) area of a triangle c) area of a rectangle2. Explain with an example how two given strings can be concatenated .3. What are the points to be kept in mind in operator overloading ?4. Explain operator overloading with example.5. Answer the questions given below the program.

    #include #include class distance{

    int feet, inches;public:void distance_assign(int f, int i){

    feet = f;inches = i;

    }

    void display(){cout

  • 7/29/2019 compqb1

    18/23

    b) increment the value of a variable of type char.8. Write a C++ program to compute x y where x and y are both integers.9. Write a C++ program to find the maximum of two integers.

    8. CONSTRUCTORS AND DESTRUCTORS

    PART I

    1. Which of the following function gets executed when an instance of a class comes into scope ?a) constructor b) destructor c) method d) member

    2. The . initializes the class object.a) destructor b) pointer c) constructor d) operator overloading3. .. gets executed when a class goes out of scope.a) pointer b) destructor c) constructor d) function overloading4. returns nothinga) constructor b) destructor c) pointer d) a and b5. are not associated with any data type.a) variables b) constants c) constructor and destructor d) functions6. . gets executed automatically when the object is created.a) constructor b) variables c) operators d) destructor 7. overloading can be applied for constructors.

    a) method b) operators c) function d) pointer 8. The constructor without parameters is called constructora) method b) operator c) function d) default9. The compiler generates .. constructors automatically.a) user defined b) default c) operator d) function10. The name of the constructor is the same as that of the ..a) data type b) scope c) class d) method11. function removes the object from the memory.a) destructor b) constructor c) scope d) pointer 12. .. is used as prefix to destructor.a) # b) @ c) ! d) ~

    13. cannot be overloaded.a) constructors b) destructors c) operators d) functions14. A class can have .. destructors.a) only one b) two c) three d) many

    PART II

    1. Differentiate constructor and destructor.2. What are the functions of constructor3. What is meant by default constructor ?4. How is copy constructor executed ?

    5. Define destructor with example.

    PART III

    1. Explain with an example the functioning of a constructor and destructor.2. Explain with an example how function overloading can be applied for constructors.3. Explain with an example how copy constructor is executed.4. Give the rules for the constructor definition and its usage.5. Give the rules for the destructor definition and its usage.

  • 7/29/2019 compqb1

    19/23

    9. INHERITANCE

    PART I

    1. . is the most powerful feature of an object oriented programming language.a) encapsulation b) inheritance c) polymorphism d) functions2. . is a process of creating a new class.a) encapsulation b) inheritance c) polymorphism d) functions3. .. is a class from which other classes are derived.a) base class b) derived class c) sub class d) methods4. class inherits all the properties of the base class.a) constructor b) destructor c) super d) derived5. .. can be added to enhance the inheritance functionality.a) attributes and data types b) methods and functions c) attributes and methods

    d) data types and functions6. keyword is used to define the name of the derived class.a) class b) void c) main() d) private7. . must be used between derived and base class.a) : : b) : c) ; d) !8. There are . access specifiers in inheritance.a) 2 b) 4 c) 6 d) 39. .. is the default visibility mode.a) public b) protected c) private d) class10. is referred to the visibility mode.a) access specifier b) constructor c) destructor d) encapsulation

    11. Which of the following of the base class are not inherited ?a) encapsulation b) destructors c) access specifiers d) constructors12. .. are executed first when an instance of the derived class is created.a) access specifiers b) constructors c) data members d) functions13. There are .. types of inheritance.a) 2 b) 3 c) 5 d) 614. form of inheritance is reflected by the transitive nature of inheritance.a) single b) multiple c) hierarchial d) multi level15. . inheritance occurs when a class is derived from a class which is a derived class itself.a) single b) multiple c) hierarchial d) multi level16. .. are executed in reverse order.

    a) access specifiers b) constructors c) destructors d) functions17. Classes used only for deriving other classes are called .a) concrete class b) abstract class c) class members d) polymorphism18. Which of the following object classes are not declared ?a) concrete b) void c) abstract d) cosntructor 19. . are executed in the order of inherited class.a) constructors b) destructors c) abstract classes d) concrete classes

    PART II

  • 7/29/2019 compqb1

    20/23

    1. Write short notes on inheritance.2. What are the advantages of inheritance ?3. Define base class.4. What are the points to be noted while defining a derived class ?5. Give the syntax of the derived class.6. What is meant by accessibility ?7. Write a note on access specifiers of inheritance.8. Name the types of inheritance.9. Define abstract class

    10. How are the constructors and destructors executed in inheritance ?11. What are the data members inherited by subtract( ) from the following program ?class add{

    private:int sum;

    protected :int num1, num2;

    public :add( );accept( );

    plus( );};class subtract : private add{

    int sub;public :

    subtract( );minus( );

    };PART III

    1. Find the errors in the following program. State reasons.

    # include class A{

    private:int a1;

    public:int a2;

    protected:int a3;

    };class B : public A

    { public:void func( ){

    int b1,b2,b3;b1 = a1;b2= a2;b3 = a3;

    }};

  • 7/29/2019 compqb1

    21/23

    void main( ){

    B der;der.a3 = \0;der.func();

    }2. Write a C++ program to find the sum and difference of two numbers using inheritance.3. Explain the scope and accessibility of the base members in the derived class.4. Explain the types of inheritance.

    10. IMPACT OF COMPUTERS ON SOCIETY

    PART I

    1. How many elements needed at least to reach out the benefits of IT to the common man ?a) 256 b) 3 c) 4 d) 182. What will be the 85% usage of computer ?a) word processing b) database c) spreadsheet d) power point3. Which of the following will enable the common man to put computers to better use ?a) application b) entertainment c) education d) hardware4. introduced in banks reduced the time required to provide service to the user ?a) software b) hardware c) methods d) IT

    5. .. permits banking from the comfort of the home by using internet facility ?a) E-Commerce b) E-banking c) E-shopping d) E-cards6. CBT means .a) Computer Based Tutorials b) Common Based Tutor c) Computer Based Teacherd) Computer Based Teaching7. .. enables online educational programs leading to degrees and certifications ?a) E-Commerce b) E-learning c) E-shopping d) E-education

    PART II

    1. What are the technical elements you need to reach out the benefits of IT to the common man ?2. How are the computers used for personal use ?3. How are the computers used for education ?

    4. How are the computers used for entertainment ?5. How are the computers used in areas of health care ?6. How are the computers used in agriculture ?

    PART III

    1. Mention the areas where software has been developed.2. Explain the use of home banking and shopping

    11. IT ENABLED SERVICES

    PART I

    1. ITES stands for a) IT Environment Studies b) IT Enabled Services c) IT Evolution Studies

    d) IT Enabled Studies2. .. helps in improving the quality of service to the users ?a) computer b) Software c) IT d) Application3. . traditional services are IT enableda) Word processors b) Spreadsheets c) Databases d) None of these4. .. can be collected for one purpose may be useful for some other purpose.a) Data b) Program c) Computer d) ITES5. .. is not an IT enabled service.a) E-governance b) call centers c) programs d) Web based services6. .. is happening all over the globe.

  • 7/29/2019 compqb1

    22/23

    a) Programs b) Application c) IT d) Hardware7. . is a category of IT enabled services pertaining to collection, digitization and processing of

    data.a) Call centers b) Data management c) E-governance d) Web based services8. services comprise punching data from manually filled forms and images.a) DBMS b) Call centers c) Digitization d) Data processing9. . is the key for effective and profitable use of IT in organizations.a) Data management b) Call centers c) E-governance d) Digitization10. is a permanent, legal document that formally states the result of a medical

    investigation.a) Call centers b) Medical Transcription c) Data management d) E-governance

    11. . facilitates communication and supports the insurance claims.a) Call centers b) Medical Transcription c) E-governance d) Web based services12. There are steps involved in Medical transcription.a) 2 b) 4 c) 3 d) 513. .. refers to the conversion of non-digital material to digital form.a) Data management b) Digitization c) Web based services d) Data processing14. Which of the following may be digitized ?a) Maps b) Manuscripts c) Images and sound d) all of these

    15. . helps us in accessing web based services.a) Programs b) Applications c) Computers d) GovernmentPART II

    1. What is meant by ITES ?2. Give the importance of ITES.3. Mention IT enabled services.4. In what way e-governance helps us ?5. Write a short note on Data Management.6. Mention any four range of ITES in Data Management category.7. Mention the organizations that can benefit from ITES in Data Management category.8. Write a short note on Medical Transcription.

    9. What is meant by Digitization ?10. Mention some areas where the digital technology is used.11. In what way web based services helps us ?

    PART III

    1. Explain the importance of ITES. 2. Write a note on call centers.3. Explain Data Management. 4. Explain the steps involved in Medical Transcription.5. Write the key benefits of digitization.

    12. COMPUTER ETHICS

    PART I

    1. Computer has its roots in the work of whom during World War II ?a) Charles Babbage b) Herman Hollerith c) Blaise Pascal d) Norbert Wiener

    2. Who began to examine unethical and illegal uses of computers by computer professionals ?a) Donn Parker b) Norbert Wiener c) Blaise Pascal d) Napier Bones3. security refers to the protection of hardware.a) Personal b) Personnel c) Physical d) Data4. .. security refers to the software setups.a) Personnel b) Personal c) Data d) Physical5. security permit only authorized access to the system.a) Personal b) Personnel c) Physical d) Data6. security refers to protecting data and computer system against negligence of employees. a)

    Data b) Physical c) Personal d) Personnel

  • 7/29/2019 compqb1

    23/23

    7. .. is any illegal activity using computer software.a) Computer crime b) Software crime c) Data crime d) System crime8. How many percentage the computer crimes happen within the company ?a) 60 % b) 75 % c) 80 % d) 100 %9. How many percentage of crimes are unreported ? a) 100 % b) 60 % c) 80 % d) 75 %10. Making and using duplicate hardware and software is called a) Crime b) Security c) Piracy d) Publicity11. . is self replicating that can cause damage to data and files.a) System b) Application c) Virus d) On-line

    12. How many known virus programs are in existence ? a) 57000 b) 67000 c) 75000 d) 8000013. How many new viruses are found each day ? a) 7 b) 4 c) 6 d) 814. . laws prevent computer crimes in India. a) Cyber b) Crime c) Legal d) Computer15. is the illegal access to the network or computer system.a) Virus b) Cracking c) Authentication d) Breaking

    PART II

    1. What does Wieners book included about computer ethics ?2. What is meant by ethics ?3. What are the general guidelines on computer ethics are needed ?

    4. What is meant by computer crime ?5. What does common computer crimes include ?6. What is meant by piracy ?7. Write a note on virus.8. What are the things to motivate piracy ?9. What is meant by theft of computer time ?10. Write a note on cracking.

    PART III

    1. Explain the different types of Data security2. What are the ten commandments of computer ethics ?