Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Now Write Some Code The code as it is now gives a 1 0 % discount for six packs. Your task is to modify it
Now Write Some Code
The code as it is now gives a discount for six packs. Your task is to modify it so that it gives a
discount for a case of bottles. It should maximize the savings by giving the maximum number of full
cases, then the maximum number of six packs from the number of bottles that didnt make it into cases, then
the number of left over bottles.
Heres some test data to check against:
Request Cases packs Singles Total Cost
If you have trouble getting the calculations to work, use the debugger to look at intermediate calculations to
see where you are going wrong.
Answer the questions for this part of the project in Gradescope.
Fix up the output
We really want to tell the person satisfying this order how many things to gather. Modify the printf statement
and make no other changes! so that your output looks like this:
C a s e s : S i x p a c k s : S i n g l e s : The t o t a l c o s t i s $
Your output must match that format EXACTLY. Notice that the printf statement is rounding the cost to the
nearest penny and has added a dollar sign to the total cost
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