Question: I need the source code in only c not c++ as instructed there.. And the same output as the example. 7 Coin Name Value ($)

 I need the source code in only c not c++ as

I need the source code in only c not c++ as instructed there.. And the same output as the example.

7 Coin Name Value ($) Value (cents) Toonie $2.00 200 cents Loonie $1.00 100 cents Quarter $0.25 25 cents Dime $0.10 10 cents Nickel $0.05 5 cents Penny $0.01 1 cent 4. Start the program by displaying to standard output (screen) the underlined title (2 lines). 5. Display the following message to the user: Enter dollars and cents amount to convert to coins: $ 6. Assume the user enters the value 9.92, this is what the screen should look like: Note: represents hitting the enter key - this is not displayed Enter dollars and cents amount to convert to coins: $9.92 1. Review the "Part-2 Output Example" (next section) to see how this program is expected to work 2. You will need to display the service fee which is calculated as 5% of the entered value. 3. You will need to deduct the service fee from the entered value to determine the total amount to be dispensed in coins. Problem: 9.92 * 0.05 = 0.496, which should be rounded up to 0.50. The printf format specifier "%.20f" will apply rounding when displaying this value, BUT don't be fooled, the actual variable value will NOT be rounded. 4. You will need to apply appropriate rounding so when you multiply by 100 (to work in total cents) and cast to an int type, which we must do at some point in the program (see below), the value will properly represent the desired rounded value for any entered initial amount. 5. Part-2 of this workshop requires you to use the modulus (%) operator (failure to use the modulus operator in all required cases will result in a zero grade). . You will need to work in total cents and use integer division with the modulus operator as required to properly calculate each coin denomination and respective remaining balance at each interval. All necessary calculations after determining the balance to be dispensed (less the service fee) must use integer division and the modulus operator (do NOT use a float or double type variable from this point onward in your program -use casting when needed) To display a floating point number based on an integer type variable holding 5 (representing 5 cents) as $0.05, you can do the following: printf("$%1.21f" (double) intBalance/100) Part-2 Output Example (Note: Use this data for submission) Change Maker Machine ======== Enter dollars and cents amount to convert to coins: $9.92 Service fee (5.0 percent): 0.50 Balance to dispense: $9.42 $2.00 Toonies X 4 (remaining: $1.42) $1.00 Loonies X 1 (remaining: $0.42) $0.25 Quarters X 1 (remaining: $0.17) $0.10 Dimes X 1 (remaining: $0.07) $0.05 Nickels X 1 (remaining: $0.02) $0.01 Pennies X 2 (remaining: $0.00) All coins dispensed

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!