Im having big trouble with making a code with loops and if statement before big test!
Hi. My teacher gave us our final program to make, yesterday, and it's 20% of our mark. It's like a big test. I am really bad at computer science and i have 55% in her class, but i want to pass it because i need the credit to graduate, and it has to be done by tommorow by the end of class. This is really hard for me, as I have tried to do it by reading the question over and over again, and reading my booklet, that she gave us at the begging of the year. She is a really bad teacher and doesn't teach us anything, so everybody has bad marks in her class. Please somebody help me write the code for that program because it's going to be really bad for me not to graduate.PLEASE SOMEBODY HELP FAST! In advance Thank you :). So the question on the assignment is:
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)
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.
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.
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.