 Answer A
float CalculateCost(float Price, int NumPurchased)
{
float TempCost;
TempCost = Price * NumPurchased;
if (TempCost > 80.0)
TempCost = TempCost  5.0;
return TempCost;
}

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

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

 Answer D
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++
