Question: Write a function named coffeeAmount to calculate the cost of a student's coffee consumption. The function will take an integer for the number of cups
Write a function named coffeeAmount to calculate the cost of a student's coffee consumption. The function will take an integer for the number of cups of coffee and a floating point value for the cost per cup. The function will return a floating point value for the total cost of coffee.
****The students use a coffee house that rewards the student for caffeine overload by giving a free cup for buying every 12 cups.**** (need help with this specifically) Calculate the cost as units times the per unit cost: cost = units * cost per unit
Your function should be named CoffeeAmount
Your function takes two input parameters: an integer number for the number of cups, a floating point number (type double) for the price of each cup
Your function has a return value: a floating point number (type double)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
