Question: Now Write Some Code: Please write the code with clion c 9 9 The code as it is now gives a 1 0 % discount

Now Write Some Code: Please write the code with clion c99
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 didn't make it into cases, then
the number of left over bottles.
Here's some test data to check against:
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:
Cases: 1, Six packs: 3, Singles: 1. The total cost is $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. Here is the starting code that is given: #include
#define COST_PER_BOTTLE 1.29
#define SIX_PACK_DISCOUNT 0.10
#define COST_PER_SIX_PACK COST_PER_BOTTLE *(1-
SIX_PACK_DISCOUNT)*6
int main(){
int number_of_bottles;
int number_of_bottles_left;
int number_of_six_packs;
double total_cost;
printf("Please enter the number of bottles:
");
scanf("%d", &number_of_bottles);
number_of_six_packs = number_of_bottles /6;
number_of_bottles_left = number_of_bottles %6;
total_cost = number_of_bottles_left *
COST_PER_BOTTLE + number_of_six_packs *
COST_PER_SIX_PACK;
printf("The total cost is %10.2f", total_cost);
return 0;
 Now Write Some Code: Please write the code with clion c99

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!