|
-
May 6th, 2001, 11:02 PM
#1
Thread Starter
New Member
The change machine
The user enters the amount due and the amount tendered. You are to calculate how much change they should receive. You are then to break down the change in $1 bills, quarters, dimes, nickles, and pennies such that the user will receive the least amount of coins. For example $0.80 is 3 quarters and a nickel not 8 dimes or 80 pennies.
-
May 7th, 2001, 03:50 AM
#2
Addicted Member
if no1 help u, tomorow ill help you, but right now its 2am and i want to sleep and i already did that program for school (i dont have the source anymore sorry man) and it's fairly easy, all u have to make sure is that your formula work. its a lot of math work and for some reasons the formula always end up ****ed lol that's why i want to wait for tomorow when my mind will be clear
*Rudy^
Visual Studio 6 Ent. SP5
Windows 2000 SP4
Windows XP SP1a
-
May 14th, 2001, 05:19 AM
#3
Addicted Member
You need to begin with the highest denomination and work down to the lowest, something like below.
Amount=2.35
dollars = (Amount mod 1)/1
Amount = Amount mod 1
quarters = (Amount mod .25)
Amount = Amount mod .25
...
..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|