Hello,
I am very new to programming and am having a hard time with a homework assignment. I am in no way asking anyone to write code for me, just hoping someone can point me in the direction of a Tutorial, Examples etc that I can use to learn from. I have read the required reading for the next lecture and have not found the Mod % function as hinted in the syllabus and pasted below.
I know how to use the printf function and scanf function to prompt and receive the user input. I am also ok figuring out the amount of change, where I am finding difficulty is with breaking the change down.
Here is the assignment from the syllabus, again, if someone could point me to some information to read and learn from I would be very much appreciative. We are using Dev-C++ compiler BTW.
Write a C program to calculate the change converter. Take input from the user for amount
due and currency note. You are required to give back the balance amount in the least
denomination (i.e. least amount of currency to be returned). The program must be able to
calculate in dollars, quarter, dime, nickel and pennies.
Example:
Amount Due = $25.52
Amount Given = $30.00
Balance Amount = $ 4.48
Given back in denomination as
$1 Bill = 4
Quarters =1
Dimes = 2
Nickels = 0
Pennies = 3Hint:
Use mod function (%)



LinkBack URL
About LinkBacks



