Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
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
urgent
c
needhelp
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
1 Answer
0
votes
answered
Sep 24, 2018
by
Bubba Whale
(
250
points)
edited
Sep 24, 2018
by
Bubba Whale
https://onlinegdb.com/HyUNzFrF7
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!
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
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.
...