+ 2

Please help!

Create a program that would accept an amount of money(integers only) and break the amount into smallest possible number of bank notes or coins in Philippines peso. Bank notes:1000,500,200,100,50,20.coins 10,5,1. Sample output: Enter amount:4328 You will be given: 4 notes of 1000.00 1 notes of 200.00 1 notes of 100.00 1 notes of 20.00 1 coins of 5.00 3 coins of 1.00

16th Sep 2019, 10:35 AM
Mahesh Muttinti
6 Réponses
+ 3
Ok
16th Sep 2019, 2:28 PM
Mahesh Muttinti
16th Sep 2019, 2:32 PM
Mahesh Muttinti
+ 1
if(digit%500==0){ This is a problem. 700 would be 1 x 500 and 1 × 200. But 700 % 500 is not 0. 3739: 9 / 5 = 1 9 % 5 = 4 -> 1 × 5 coins -> 4 × 1 coins 30 / 50 = 0 30 / 20 = 1 30 % 20 = 10 10 / 10 = 1 10 % 10 = 0 -> 1 × 20 -> 1 × 30 700 / 500 = 1 700 % 500 = 200 200 / 200 = 1 200 % 200 = 0 -> 1 × 500 -> 1 × 200 4000 / 1000 = 4 -> 4 × 1000 Hope this helps.
16th Sep 2019, 2:56 PM
Denise Roßberg
Denise Roßberg - avatar
0
Where is your problem? Show us your code so we can help you.
16th Sep 2019, 2:27 PM
Denise Roßberg
Denise Roßberg - avatar
0
Please post just the link to your code (from code playground). Thanks.
16th Sep 2019, 2:30 PM
Denise Roßberg
Denise Roßberg - avatar
0
Mahesh Muttinti Hope this code helps to understand what I mean: https://code.sololearn.com/c43bY7R6kZRY/?ref=app
16th Sep 2019, 4:29 PM
Denise Roßberg
Denise Roßberg - avatar