C Programming Tutorial pdf Online Test - Set 13 - ObjectiveBooks

C Programming Tutorial pdf Online Test - Set 13

Practice Test: Question Set - 13

1. Procedural cohesion is similar to sequential cohesion, except that with procedural cohesion _______
    (A) The tasks are not done in order
    (B) The tasks are simpler
    (C) The tasks share data
    (D) The tasks do not share data

2. Evaluate the following expression: 4 >6 || 10 < 2 * 6
    (A) True
    (B) False

3. The function strcmp("Jose", "JOSE") will return ________
    (A) - 1
    (B) 0
    (C) 1
    (D) None of the above

4. If a base class member is private, then
    (A) If a derived class uses the public access specifier, the data member becomes public
    (B) If a derived class uses the protected access specifier, the data member becomes protected
    (C) Both (a) and (b)
    (D) Neither (a) nor (b)

5. Which of the following statements is false?
    (A) You typically use a public member function to change the value in a private data member
    (B) Because the constructor function does not return a value, you place the keyword void before the constructor's name
    (C) The public member functions in a class can be accessed by any program that uses an object created from that class
    (D) An instance of a class is considered an object

6. A default exception block must be placed ________
    (A) First among the catch blocks
    (B) Last among the catch blocks
    (C) Globally, at the top of the file
    (D) At the end of all code in the program

7. Reference variables and const class member
    (A) Must be assigned values in any derived class
    (B) Must never be initialized in a base class
    (C) Must be initialized, rather than assigned values
    (D) Must not exit if a class is to be a base class

8. The items listed in the function header are called _______
    (A) Actual arguments
    (B) Formal parameters
    (C) Passed parameters
    (D) Sent arguments

9. Variables that are known only to the function in which they are declared are called _______ variables
    (A) Global
    (B) Local
    (C) Main
    (D) Separate

10. The _______ function returns the uppercase equivalent of a character
    (A) caseupper
    (B) charupper
    (C) toupper
    (D) uCase

11. You must provide a constructor for a derived class
    (A) Always
    (B) If the base class constructor required arguments
    (C) If the base class constructor does not required arguments
    (D) Never

12. Which of the following operators is the equality operator?
    (A) !=
    (B) =
    (C) ==
    (D) ->>

13. Typing the function's name as Main, rather than main, is an example of
    (A) An entry error
    (B) A function error
    (C) A logic error
    (D) A syntax error

14. If a derived class uses the public access specifier, then _______
    (A) Public base class members remain public in the derived class
    (B) Protected base class members become public in the derived class
    (C) Both (a) and (b)
    (D) Neither (a) nor (b)

15. The body of a C++ function is surrounded by _______
    (A) Parentheses
    (B) Angle brackets
    (C) Curly brackets
    (D) Square brackets

Show and hide multiple DIV using JavaScript View All Answers

 Next Tests:

    Blogger Comment
    Facebook Comment