Question: Part 3. Write a function called totalCost that takes three parameters (shipping cost, cost of one box, and number of boxes purchased) and returns the
Part 3. Write a function called totalCost that takes three parameters (shipping cost, cost of one box, and number of boxes purchased) and returns the total cost which is computed using the following formula: shipping cost(number of boxes purchased) (cost of one box). Default values for the parameters are the following: shipping cost is 0, cost of one box is $4, number of boxes is 1 In the main function test your totalCost function with no arguments, 1 argument, 2 arguments, and 3 arguments. Make sure that your output clearly states the number of arguments that is being tested, the values of the arguments, and the total cost value that is returned. Call your program part3.cpp Use program fig15 08.cpp from the textbook as an example of using default arguments
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
