Question: Please help! Code in basic C (not C++)! Program Which one will smell sweeter? Were going to extend our program for managing flower orders to
Please help! Code in basic C (not C++)!
Program
Which one will smell sweeter?
Were going to extend our program for managing flower orders to incorporate discounts for larger orders.
The program should behave as follows: Well still be getting the customers number of flowers and well also be getting the type of flower, which should be one of the following letters: R (for roses), I (for irises), or L (for lillies). Well do that for two different orders. For example (the highlighted part is what the program displays and the italicized part is the user input): Flower Order 1 (#flowers type): 3 R
We want to reward customers for larger flower orders, so we'll be applying a discount to their overall orders.
Finally, we need to let the user know which order is the cheapest or if they're the same cost.
Requirements
The starting price of each rose will always be $4.99. The starting price of each iris will always be $2.99. The starting price of each lily will always be $1.75.
For every additional flower over 6, a 3% discount should be applied. For example, if the customer orders 8 roses then a 6% discount would be applied to the overall price. The discount should never be more than 50% off.
The user should be prompted for a set of two values which represent the number of flowers and the flower type for the first order. The user should enter both values on one line, separated by spaces. The user should then be prompted for the remaining flower order.
Example Program Execution:
These are just a few example of how the program should run. Your program should be able to handle any input that is entered in the correct format.
Hints:
Make sure you try out different test cases!
Plan out your calculations and comparisons, then implement them in code.
Play close attention to using scanf with variables.
Make sure you control the formatting of any floating-point output.
Program must match example output for credit! Thank you so much!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
