Answered step by step
Verified Expert Solution
Link Copied!

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 10% discount for six packs. Your task is to modify it so that it gives a 15%
discount for a case of 24 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 6-packs Singles Total Cost
4313148.504
4820052.632
3111134.572
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 : 1, S i x p a c k s : 3, S i n g l e s : 1. The t o t a l c o s t i s $48.50
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

15-5 How will MIS help my career?

Answered: 1 week ago