CS253: Software Development with C++

Fall 2018

IQ 08

CS253 IQ 08

See this page as a slide show

Reflection

int zulu;
cout << typeid(zulu).name() << '\n';
i

What will this code emit?

  1. int zulu
  2. int
  3. zulu
  4. i
  5. It cannot be determined.

Virtual Inheritance

What problem does virtual inheritance address?

  1. Stroustrup’s Syntax Sin
  2. Polymorphic Pointers
  3. Namespace Numbering
  4. Method Mangling
  5. Dreaded Diamond

Programming Paradigms

Which statement is true?

  1. Makefiles are event-driven.
  2. C++ is event-driven.
  3. Spreadsheets are imperative.
  4. Graphics programs are declarative.
  5. Object files are declarative.
  6. This question is ill-defined.

Exceptions

What sort of argument can throw take?

  1. only std::Exception and classes derived from it
  2. any scalar or object
  3. any scalar or copy-constructable object
  4. any object
  5. any copy-constructable object

Exceptions

int main() {
    throw 42;
    cout << "honeybee\n";
}
terminate called after throwing an instance of 'int'
SIGABRT: Aborted

🐝

What will this program display?

  1. 42
    honeybee
    an error message
  2. honeybee
    an error message
  3. an error message
    honeybee
  4. honeybee
  5. an error message

User: Guest

Check: HTML CSS
Edit History Source

Modified: 2018-07-11T15:28

Apply to CSU | Contact CSU | Disclaimer | Equal Opportunity
Colorado State University, Fort Collins, CO 80523 USA
© 2018 Colorado State University
CS Building