OOPSE questions 11-20
10 Questions
8 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Select one:

  • Unknown exception
  • No exception
  • Exception(int) with value: 10 (correct)
  • Exception(double) with value: 1.1

The following code snippet:

template T& min(T& l, T& r) { return l <= r ? l : r; }

represents:

  • a function template that can always be instantiated
  • a part of class template that can be instantiated if the &lt;= operator is defined for type T
  • a function template that can be instantiated if the &lt;= operator is defined for type T (correct)
  • a class template

Inheritance in C++ has the following properties:

  • it is not allowed to inherit from many classes at once
  • it's impossible to call the method which is defined in a base class inside a method that overrides it
  • is a mechanism of reusing and extending existing classes without modifying them (correct)
  • the same method may have different meanings in derived classes (correct)

Inheritance in C++ is possible when:

<p>both declarations and the object code of base class(es) are available (B), both declarations and the sources of base class(es) are available (C)</p> Signup and view all the answers

When we apply the object-oriented paradigm, we in general:

<p>manage the state of an object with the use of methods that belong to the object's class (C)</p> Signup and view all the answers

Qt's signals/slots mechanism has the properties:

<p>signal and slots are loosely coupled: a class which emits a signal neither knows nor cares which slots receive the signal (A), if you connect a signal to a slot, the slot will be called with the signal’s parameters at the right time (D)</p> Signup and view all the answers

To declare an operator function in C++:

<p>use an existing operator symbol, prefixing it with the operator keyword (D)</p> Signup and view all the answers

The vector class in the C++ Standard Library has the properties:

<p>Provides a constant time insertion and removal of elements at the end and beginning (A), Provides a list-like interface, constant time insertion and removal of elements at the end, and linear time insertion and removal of elements at the beginning or in the middle (B), Provides an array-like interface with enhancements, but does not support resizing (C), Provides a stack-like interface, but does not support insertion and removal of elements (D)</p> Signup and view all the answers

The following C++ code snippet:

int a; double d; ofstream os("Data.csv"); os << a << "," << d;

will:

<p>save the values of the a and d variables in the file (D)</p> Signup and view all the answers

In order to test the indexing operator with the use of equivalence partitioning and boundary values analysis methods, one needs to prepare a test suite with:

<p>at least 5 values of 'i' parameter (D)</p> Signup and view all the answers

More Like This

Use Quizgecko on...
Browser
Browser