about | help | code help+videos | done | prefs |
Write a function named getCostOfCoffee() that has a parameters named numberOfCoffees and pricePerCoffee. Given this information, the function returns the total cost of the coffee order. This is not a simple multiplication of cost and quantity, however, because the coffee shop has an offer where you get one free coffee for every eight coffees you buy. getCostOfCoffee(7, 2.5) → 17.5 getCostOfCoffee(8, 2.5) → 20.0 getCostOfCoffee(9, 2.5) → 20.0 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 201 Post-solution available
Copyright Nick Parlante 2017 - privacy