Question: C program You have to write a complete C program that compiles and runs in Codeblocks, but the function is the most important part to

 C program You have to write a complete "C" program that

C program

You have to write a complete "C" program that compiles and runs in Codeblocks, but the function is the most important part to be evaluated in this question. The function must: - Receive the following parameters: price of the item including cents, and amount used as payment. - Calculate the number of Dollars, Quarters, Dimes, Nickels, and Pennies, to complete the change amount. - Print the number of each coins value needed to complete the change. The main must: - Prompt the user for the exact price of the item Prompt the user for the sum of the bills that will be used for payment - Call the function passing the two values as paramenters. Prompt the user AGAIN for the exact price of a NEW item (double). If the user answers with a negative number (-1) then the program ends. Otherwise you must prompt the user for the sum of the bills that will be used for payment of the NEW item (int) The main keeps calling the function until the user answer to the exact price is a negative number Hints: In the function .. 1. Calculate the total number of cents needed for the change. (payment - price Tag) 2. For each type of coin starting with the biggest value calculate the number of coins needed for the change: for instance (numQuarters = numCents / 25) gives you the number of quarters. 3. After each number of coins calculation is completed, calculate the amount of change left, this is the remainder (changeLeft = numCents % 25) The following is an example of how your program should look when you execute it

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!