Question
BEFORE YOU START READING I WANT TO NOTE THAT YOU MAKE SURE TO READ THE ENTIRE QUESTION BC IVE ASKED THIS NOW LIKE 3 TIMES
BEFORE YOU START READING I WANT TO NOTE THAT YOU MAKE SURE TO READ THE ENTIRE QUESTION BC IVE ASKED THIS NOW LIKE 3 TIMES AND HAVENT GOTTEN A CORRECT COMPLETE ANSWER.
I already have a function to find out the coffeeamount with the two parameters, but I dont know how to account for the free cup of coffee if 12 are bought.
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 ON 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started