TRB - MASTER-COMPUTER (QUIZ-2)
Quiz
1 . A default catch block catches- all thrown objects
- no thrown objects
- any thrown object that has not been caught by an earlier catch block
- all thrown objects that have been caught by an earlier catch block
- 2 . Format flags may be combined using
- the bitwise OR operator (|)
- the logical OR operator (||)
- the bitwise AND operator (&)
- the logical AND operator (&&)
- 3 . The use of the break statement in a switch statement is
- optional
- compulsory
- not allowed. It gives an error message
- to check an error
- 4 . To expose a data member to the program, you must declare the data member in the _____ section of the class
- common
- exposed
- public
- unrestricted
- 5 . Which of the following are valid characters for a numeric literal constant?
- a comma
- a dollar sign ($)
- a percent sign (%)
- None of the above
- 6 . A function that changes the state of the cout object is called a(n) _____
- member
- adjuster
- manipulator
- operator
- 7 . A C++ program contains a function with the header int function(double d, char c). Which of the following function headers could be used within the same program?
- A. char function(double d, char c)
- B. int function(int d, char c)
- C. both (a) and (b)
- D. neither (a) nor (b)
- 8 . When the compiler cannot differentiate between two overloaded constructors, they are called
- overloaded
- destructed
- ambiguous
- dubious
- 9 . If you design a class that needs special initialization tasks, you will want to design a(n) _____
- housekeeping routine
- initializer
- constructor
- compiler
- 10 . Which type of statement does not occur in computer programs?
- sequence
- loop
- denial
- selection
11 . The newline character is always included between- pair of parentheses
- pair of curly braces
- control string
- &
- 12 . To be called object-oriented, a programming language must allow
- functions that return only a single value
- #include files
- inheritance
- All of the above
- 13 . A function that returns no values to the program that calls it is _____
- not allowed in C++
- type void
- type empty
- type barren
- 14 . The keyword used to define a structure is _____
- stru
- stt
- struct
- structure
- 15 . If container classes are carefully constructed, then these tools are available to work with structures that are not ______
- valid without container classes
- programmer-defined
- type-specific
- public
- 16 . Header files often have the file extension _____
- .H
- .HE
- .HEA
- .HEAD
- 17 . The #ifndef directive tests to see whether ________
- a class has been defined
- a variable has been given a value
- a class has no variable definitions
- any objects of the class have been instantiated
- 18 . The generic type in a template function
- must be T
- can be T
- cannot be T for functions you create, but may be for C++'s built-in functions
- cannot be T
- 19 . When a child class function is called, the compiler looks first for a matching function name in the _____
- class of the object using the function name
- immediate ancestor class
- base class
- descendant class
- 20 . A function that is called automatically each time an object is destroyed is a
- constructor
- destructor
- destroyer
- terminator
21 . If you create an instantiation of a class template with an int, and then create a second instantiation with a double, then- you must precede each function call with the word int or double
- once a function is used as one type, it becomes unavailable for use with the other type
- there is no difference in the procedure to call a member function
- you cannot perform this operation in C++
- 22 . The step-by-step instructions that solve a problem are called _____
- an algorithm
- a list
- a plan
- a sequential structure
- 23 . The type to be used in an instantiation of a class template follows ________
- the generic class name
- the keyword template
- the keyword class
- the template definition
- 24 . Which of the following statements allows the user to enter data at the keyboard?
- cin << currentPay;
- cin >> currentPay;
- cout << currentPay;
- cout >> currentPay;
- 25 . When you pass a variable _____, C++ passes only the contents of the variable to the receiving function
- by reference
- by value
- C. globally
- D. local
- 26 . The best form of coupling is _____
- complete
- tight
- loose
- free
- 27 . Paying attention to the important properties while ignoring inessential details is known as________
- selectiveness
- polymorphism
- abstraction
- summarizing
- 28 . What does C++ append to the end of a string literal constant?
- a space
- a number sign (#)
- an asterisk (*)
- a null character
- 29 . An array name is a _____
- subscript
- formal parameter
- memory address
- prototype
- 30 . To enter a comment in a C++ program, you begin the comment with _____
- **
- &&
- \\
- //
- 31 . Which of the following is(are) invalid string constant(s)?
- '7.15 pm'
- "i like e"
- "7.3el2"
- "1234el2"
- 32 . You define a structure type globally because _____
- you save many lines of code by not rewriting an identical structure definition in each function that uses it
- you will never change its definition
- it is required in C++
- All of the above
- 33 . Overloaded functions are required to
- have the same return type
- have the same number of parameters
- perform the same basic functions
- None of the above
- 34 . Redirection redirects
- a stream from a file to the screen
- a file from a device to a stream
- a device from the screen to a file
- the screen from a device to a stream
- 35 . You mark the beginning of a function's block of code with the _____
- v
- *
- {
- }
- 36 . Sending a copy of data to a program module is called _______
- passing a value
- making a reference
- recursion
- setting a condition
- 37 . Of the three ways to pass arguments to functions, only passing by _____ and passing by _____ allow the function to modify the argument in the calling program
- reference, pointer
- array, location
- array, pointer
- None of the above
- 38 . To use either an input or output file, the program must include the _____ header file
- filestream.h
- fstream.h
- instream.h
- inoutstream.h
- 39 . A widget is to the blueprint for a widget as an object is to
- a member function
- a class
- an operator
- a data item
- 40 . C++ allows you to define the same functions more than once in the same program _____
- if the definitions are identical
- if the definitions are included in two separate #include files
- if the definitions are located in a single #include file that is included more than once
- C++ does not allow you to define the same functions more than once in the same program
- 41 . Which of the following assigns the number 5 to the area variable?
- area 1 = 5
- area = 5
- area == 5
- area --> 5
- 42 . A base class may also be called a
- child class
- subclass
- derived class
- parent class
- 43 . The _____ mode tells C++ to open a file for input
- add::ios
- in::file
- ios::app
- ios::in
- 44 . Using the wardrobe structure within the ShopList structure is an example of a good programming principle, known as _____
- reusability
- polymorphism
- redundancy
- recursion
- 45 . When you omit parameters from a function call, values can be provided by
- formal parameters
- reference parameters
- overloaded parameters
- default parameters
- 46 . The first element in a string is
- the name of the string
- the first character in the string
- the length of the string
- the name of the array holding the string
- 47 . Variables declared outside a block are called _____
- global
- universal
- stellar
- external
- 48 . The compiler converts your C++ instructions into _____
- edited code
- object code
- source code
- translated code
- 49 . A fundamental type such as int or double is a _____
- programmer-defined type
- complex type
- nonscalar type
- scalar type
- 50 . The return type you code for all constructors is _____
- void
- the class type
- the same type as the first data member defined in the class
- no type
Answer podunga velux sir
பதிலளிநீக்குSir give answers for the questions.that is very useful.
பதிலளிநீக்குAnd please
பதிலளிநீக்குCheck 4th question b/c answer
பதிலளிநீக்குIt is very
பதிலளிநீக்குuseful
Very useful in this test.. thank u sir.
பதிலளிநீக்கு20. answer is detructor
பதிலளிநீக்கு