Mark As Completed Discussion

Are you sure you're getting this? Click the correct answer from the options.

In the context of the finance-themed example provided earlier, which one of the following codes demonstrates the use of both inheritance and polymorphism?

Click the option that best answers the question.

  • `FinancialDerivative Derivative; Derivative.CalculateValue();`
  • `Stock s; FinancialDerivative *d = &s; d->CalculateValue();`
  • `FinancialDerivative *d; Stock s; d = &s; d->CalculateValue();`
  • `Stock s; FinancialDerivative d = s; d.CalculateValue();`