954,496 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problem with a program

I have to write a program for computer science that takes in the total amount of goods your buying and what amount your paying with and then outputs how much change you will receive. So for example your buying something for $3.99 and you have a $5 bill then it should output "1 loonie and 1 penny".
I have no idea how to do it. I tried using modulus division but I just ended up getting even more confused.
I don't want the program I just need to know how to do it.
Thanks in advance.

networkZombie
Newbie Poster
12 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

Please post your code, as you are probably on the right track. Think of how you would do it in life. Change is 1.01, how many dollars? 1. Remaining change 0.01. How many quarters? 0. dimes? 0. nickels? 0, pennies? 1. Remaining change, 0.00. What would happen if the change were 0.41?

jonsca
Quantitative Phrenologist
Team Colleague
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: