Question: in C++ Write a function CalcApples that given a total quantity of individual apples, calculates the number of dozens, number of singles and the total

in C++
in C++ Write a function CalcApples that given a total quantity of

Write a function CalcApples that given a total quantity of individual apples, calculates the number of dozens, number of singles and the total cost for the apples. The price of the apples is twelve cents each, or $1.25 per dozen (1 dozen - 12 apples). The function should have as logical input the total number of apples, and as a result of the function call, the logical output should be the number of dozens, the number of singles (less than a doren) and the total cost of the apples. For example, if the variable totalApples has a value of 35, the function call might look something like this: tot - Colchools(totalApples, ose, singles); Thus after the function returns, the caller would then be able to display that given 35 apples, there are 2 dozen with 11 singles for a total cost of $3.82

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!