CIS Logo SVC Logo

   Computing & Information Systems
   Department

 

Schoology Facebook        Search CIS Site      Tutorials

Software Design Using C++



Review of Functions and Parameters



Answering the Question


You selected Answer B, shown below. This is not a correct solution to this part of the problem. The ampersand in front of a parameter indicates a reference parameter. However, only parameters in which answers are being sent back should be reference parameters. Go back and try again.


void CalculateCost(float & Price, int & NumPurchased, float & Cost)
   {
   Cost = Price * NumPurchased;
   if (Cost > 80.0)
      Cost = Cost - 5.0;
   }

You can go back to the overall review listing: Review of Introductory Topics.

Back to the main page for Software Design Using C++

Author: Br. David Carlson with contributions by Br. Isidore Minerd
Last updated: January 15, 2013
Disclaimer