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 C, shown below. This is an incorrect solution to this part of the problem. It fails to send the answer back. Any answer that you want to send back in a parameter must use a reference parameter, indicated with an ampersand (unless you are dealing with an array). 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