TRB - MASTER-COMPUTER (QUIZ-3) C++ Programming
Quiz
- When an object-oriented program detects an error within a function, the function _________
- throws an exception
- throws a fit
- catches a message
- catches an exception
- Using a statement at the wrong time or with an inappropriate object creates a
- logical error
- syntax error
- compiler error
- language error
- The Internet service that provides a multimedia interface to available resources is called
- World Wide Web
- File Transfer Protocol
- Gopher
- Telnet
- When you create a derived class and instantiate an object _____
- the parent class object must be constructed first
- the child class object must be constructed first
- the parent class object must not be constructed
- the child class object must not be constructed
- A constructor always has
- communicational cohesion
- temporal cohesion
- logical cohesion
- no cohesion
- A normal C++ operator that acts in special ways on newly defined data types is said to be
- glorified
- encapsulated
- classified
- overloaded
- A function in a derived class that has the same name as a function in the parent class
- will override the base class function
- will cause an error message to display
- will be overridden by the base class function
- will execute immediately often the base class function executes
- In which statements, does a 'continue' statements cause the control to go directly to the test condition and then continue the looping process?
- 'for' and 'while'
- 'while' and 'if-else'
- 'do-while' and 'if-else'
- 'while' and 'do-while'
- Which of the following statements is false?
- You typically use a public member function to change the value in a private data member
- Because the constructor function does not return a value, you place the keyword void before the constructor's name
- The public member functions in a class can be accessed by any program that uses an object created from that class
- An instance of a class is considered an object
- In a class specifier, data or functions designated private are accessible
- to any function in the program
- only if you know the password
- to member functions of that class
- only to public members of the clas
- When a function includes a throw statement for errors, the call to the potentially offending function should be placed within a _____ block
- throw
- try
- catch
- scope
- The scope resolution operator is
- a comma
- a semicolon
- a colon
- two colons
- "C++" is a _____ constant
- character literal
- named literal
- numeric literal
- string literal
- In a C++ program, which of the following can be thrown?
- scalar variables
- programmer-defined objects
- both (a) and (b)
- neither (a) nor (b)
- The items listed in the function header are called _____
- actual arguments
- formal parameters
- passed parameters
- sent arguments
66 . A translator that notes whether you have used a language correctly may be called a _____- theasurus
- compiler
- coder
- decoder
- The feature in object-oriented programming that allows the same operation to be carried out differently, depending on the object, is_____
- inheritance
- polymorphism
- overfunctioning
- overriding
- When an argument is passed by reference,
- a variable is created in the function to hold the argument's value
- the function cannot access the argument's value
- a temporary variable is created in the calling program to hold the argument's value
- the function accesses the argument's original value in the calling program
- The process of extracting the relevant attributes of an object is known as
- polymorphism
- inheritance
- abstraction
- data hiding
- Which of the following statements uses the computer's clock to initialize the random number generator?
- srand(time);
- srand(time(NULL));
- time(srand);
- time(srand(NULL));
- A static data member is given a value
- within the class definition
- outside the class definition
- when the program is executed
- never
- You must provide a constructor for a derived class
- always
- if the base class constructor required arguments
- if the base class constructor does not required arguments
- never
- If you want to override constructor default values for an object you are instantiating, you must also override
- all other parameters to that constructor
- all parameters to the left of that value
- all parameters to the right of that value
- no other parameters to that constructor
- 74 . To use one of the C++ built-in mathematical functions, you must include the _____ header file in your program
- calculation.h
- compute.h
- expression.h
- math.h
- Errors in a program are called
- accidents
- annoyances
- bugs
- mistakes
- If you declare two objects as Customer firstCust, secondCust; which of the following must be true?
- Each object's nonstatic data members will be stored in the same memory location
- Each object will be stored in the same memory location
- Each object will have a unique memory address
- You cannot declare two objects of the same class
- Which of the following is the inequality operator?
- !=
- =
- ==
- -->
- If a derived class uses the public access specifier, then _____
- public base class members remain public in the derived class
- protected base class members become public in the derived class
- both (a) and (b)
- neither (a) nor (b)
- 79 . The operator that releases previously allocated memory is _____
- release
- return
- delete
- destroy
- 80 . When a language has the capability to produce new data types, it is said to be
- reprehensible
- encapsulated
- overloaded
- extensible
- 81 . A compound statement does not consist of
- a single statement
- other compound statements
- expression statements
- control statements
- 82 . Which of the following statements will display the word "Hello" on the computer screen?
- cin << "Hello";
- cin >> "Hello";
- cout << "Hello";
- cout >> "Hello";
- 83 . The preprocessor directive always starts with the symbol
- %
- &
- #
- ""
- 84 . Which of the following statements is true?
- Data coupling is tighter than pathological coupling
- Common coupling is looser than data coupling
- Data-structured coupling is looser than control coupling
- Control coupling is looser than data coupling
- 85 . The base class for most stream classes is the _____ class
- ios
- out
- in
- app
- 86 . Which of the following while clause will stop the loop when the value in the age variable is less than the number 0?
- while age < 0
- while (age < 0)
- while age >= 0;
- while (age >= 0)
- 87 . The most efficient data type for a variable that stores the number 4.6e20 is the _____ data type
- Character
- Double
- Float
- Long Integer
- 88 . Which of the following is a C++ object?
- cin
- >>
- iostream
- read()
- 89 . Which of the following can be used to declare the main function?
- void main
- void Main()
- void main()
- main
- 90 . You _____ write your own container classes
- must
- may
- should not
- must not
- 91 . If an integer object is thrown with a throw statement, then a subsequent catch block has a usable match if the type of the catch argument is
- int
- double
- either (a) or (b)
- neither (a) nor (b)
- 92 . The highest level of cohesion is
- functional cohesion
- temporal cohesion
- logical cohesion
- sequential cohesion
- 93 . You separate a derived class name from its access specifier with
- a colon
- two colons
- at least one space
- a semicolon
- 94 . The last statement in a function is often a(n) _____
- return
- goodbye
- finish
- endfunction
- 95 . When the function int someFunction(char c) throw( ) is executed, _____
- it can throw anything
- it may throw an integer
- it may throw a character
- it may not throw anything
- 96 . The two statements that can be used to change the flow of control are
- if and switch
- if and while
- switch and do-while
- break and continue
- 97 . If p and q are assigned the values 2 and 3 respectively then the statement p = q++
- gives an error message
- assigns a value 4 to p
- assigns a value 3 to p
- assigns a value 5 to p
- 98 . Which of the following is the insertion operator?
- >>
- <<
- //
- /*
- 99 . If you want only one memory location to be reserved for a class variable, no matter how many objects are instantiated, you should declare the variable as
- static
- unary
- dynamic
- volatile
- 100 . To use a template class member function, use the ________ with the instantiation
- scope resolution operator
- dot operator
- class definition
- keword template
Not easy to select difficult process
பதிலளிநீக்குIt was really useful
பதிலளிநீக்குNice
பதிலளிநீக்குVery nice preparation
பதிலளிநீக்குGOOD COLLECTION OF QUESTIONS. THANK U SIR.
பதிலளிநீக்குUseful sir
பதிலளிநீக்குAns sir
பதிலளிநீக்குI need crct answer to check my answer
பதிலளிநீக்குPlease join to me
பதிலளிநீக்குGood colletions..thanks for sharing
பதிலளிநீக்கு