RECIEVING THE WRONG OUTPUT

0 votes
asked Sep 24, 2018 by Qibs
THE CODE IS IN HERE, THERE WAS TO MANY CHARACTERS TO UPLOAD HERE DIRECTLY:

https://textuploader.com/dvyrb

1 Answer

0 votes
answered Sep 24, 2018 by Bubba Whale (250 points)
edited Sep 24, 2018 by Bubba Whale
commented Sep 24, 2018 by Qibs
Its working fine but there is a 0.06 from the second last one and it should be a 0.01.
commented Sep 24, 2018 by Bubba Whale (250 points)
Yea I saw, fixed it: https://onlinegdb.com/HyUNzFrF7
Also if you want the last 'owing = 0.00$' and not '-0.00$' just change the last bal to 'bal = 0;'
because after you pay in pennies you wont have anything less.
commented Sep 24, 2018 by anonymous
Its not fixed now its
Please enter the amount to be paid: $8.68                                                                                                                                       
GST: 1.13                                                                                                                                                                       
Balance owing: $9.81                                                                                                                                                            
Loonies required: 9, balance owing $0.81                                                                                                                                        
Quarters required: 3, balance owing $0.06                                                                                                                                       
Dimes Required: 0, balance owing 0.06$                                                                                                                                          
Nickels required: 1, balance owing $0.01                                                                                                                                        
Pennies required: 2, balance owing -0.01$
commented Sep 24, 2018 by Qibs
it should be like this
GST: 1.13                                                                                                                                                                       
Balance owing: $9.81                                                                                                                                                            
Loonies required: 9, balance owing $0.81                                                                                                                                        
Quarters required: 3, balance owing $0.06                                                                                                                                       
Dimes Required: 0, balance owing $0.06                                                                                                                                          
Nickels required: 1, balance owing $0.01                                                                                                                                        
Pennies required: 1, balance owing $0.0

Sorry, for the spam back and forward!
commented Sep 24, 2018 by Qibs
NVM Thank you kind sir I got it to work, I still had to touch up your code and know it works thank you so very much!
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...