What is the output of the following function and function call?
void calculateCost(int count, float& subTotal, float taxCost);
float tax = 0.0,
subtotal = 0.0;
calculateCost(15, subtotal,tax);
cout << "The cost for 15 items is " << subtotal
<< ", and the tax for " << subtotal << " is " << tax << endl;
//end of fragment
void calculateCost(int count, float& subTotal, float taxCost)
{
if ( count < 10)
{
subTotal = count * 0.50;
}
else
{
subTotal = count * 0.20;
}
taxCost = 0.1 * subTotal;
}
a. The cost for 15 items is 3.00, and the tax for 3.00 is 0.30;
b. The cost for 15 items is 0.00, and the tax for 3.00 is 0.00;
c. The cost for 15 items is 0.00, and the tax for 3.00 is 0.30;
d. The cost for 15 items is 3.00, and the tax for 3.00 is 0.00;
d. The cost for 15 items is 3.00, and the tax for 3.00 is 0.00;
You might also like to view...
Match each of the following terms to its meaning:
I. run II. sketch III. library IV. IDE V. interact A. The output of Processing language B. programming environment C. execute the program D. collections of additional functionalities E. control the sketch with human input
To create objects, a(n) ________ can be used to serve as a step-by-step guide
Fill in the blank(s) with correct word
Text is ________ when it is too long to fit in a cell and the cell to the right of it contains data
Fill in the blank(s) with correct word
Which of the following commands will show a number of environment variables that start with LC_?
a. printenv b. localvar c. locale d. env