# Im having big trouble with making a code with loops and if statement before big test!

• January 24th, 2013, 08:03 PM
Kiro_6
Im having big trouble with making a code with loops and if statement before big test!

Task: Write a program that produce the coins needed to make up the amount of money a user inputs. Input to the program should be a positive integer representing an amount of money in cents. Output should be the amount of money along with how it would be made up in coins( toonies(2 dollars), loonies(1 dollar), quarters(25 cents), dimes(10 cents), nickels(5 cents), pennies(1 cent) that could make up that amount(use the largest coin values first, the move down to smaller coin values as needed). In printing the results, the program should print results in a reasonable, organized and communicative way. Also, the user should be given prompts so that they know what to enter.

Sample input: Enter the number of cents 558
Sample output: 2 toonie(s), 1 loonie(s), 2 quarter(s), 0 dime(s), 1 nickel(s), 3 pennie(s)
• January 24th, 2013, 08:32 PM
Norm
Re: Im having big trouble with making a code with loops and if statement before big test!
Do you have any specific questions about your assignment?
Please post your code and any questions about problems you are having.
• January 24th, 2013, 10:01 PM
Kiro_6
Re: Im having big trouble with making a code with loops and if statement before big test!
Thank you for replying Norm! The problem is that i have no idea how to do the code for this program. I started it with all the things I need like Scanner, variables etc. but then I can't do the rest with loops and if statements and things like that.
• January 25th, 2013, 05:53 AM
Norm
Re: Im having big trouble with making a code with loops and if statement before big test!
Do the program in small steps. Write some of the code for what you know how to do, compile it and test it. Fix the problems, compile and test again. Continue until that small part works, then try to add one more small part using the same small steps.

When you get to a part you are having problems with, post the code and a description of your problems.