GoConqr has a new look! Let us know what you think.

Quiz

C++ 2

Ummm No 30 questions

Take the quiz

Questions in this quiz (30)

  1. 1This directive is used to create an "include guard," which allows a program to be conditionally compiled. This prevents a header file from accidentally being included more than once
    1. A#include
    2. B#guard
    3. C#ifndef
    4. D#endif
    5. ENone of these
  2. 2The constructor function's return type is ________.
    1. Aint
    2. Bfloat
    3. Cchar
    4. Dstructure pointer
    5. ENone of these
  3. 3A C++ class is similar to one of these.
    1. Ainline function
    2. Bheader file
    3. Clibrary function
    4. Dstructure
    5. ENone of these
  4. 4What is the output of the following program?Image for question 4
    1. AThe program runs, but with no output.
    2. B77
    3. CHello!
    4. DThe program will not compile.
  5. 5When using smart pointers to dynamically allocate objects in C++ 11, it is unnecessary to delete the dynamically allocated objects because the smart pointer will automatically delete them.
    1. ATrue
    2. BFalse
  6. 6Class objects can be defined prior to the class declaration.
    1. ATrue
    2. BFalse
  7. 7When an object is defined without an argument list for its constructor, the compiler automatically calls the object's default constructor.
    1. ATrue
    2. BFalse
  8. 8The constructor function may not accept arguments.
    1. ATrue
    2. BFalse
  9. 9Members of a class object are accessed with the ________.
    1. Adot operator
    2. Bcin object
    3. Cextraction operator
    4. Dstream insertion operator
    5. ENone of these
  10. 10The process of object-oriented analysis can be viewed as the following steps:
    1. AIdentify objects, then define objects' attributes, behaviors, and relationships
    2. BDefine data members and member functions, then assign a class name
    3. CDeclare private and public variables, prototype functions, then write code
    4. DWrite the main() function, then determine which classes are needed
    5. ENone of these

Information

Description
C++ 2 Quiz on C++ 2, created by Ummm No on 23/09/2016.
Author
Ummm No
Language
English
Views
7
Tags
c++ 2
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?