1 Attachment(s)
Help with CoinCounter method
I was working with Dr. Java on my class assignment while the professor solved some of the first questions. Not sure how, but i deleted all of my CoinCounterTest (the assignment) and wasn't able to retrieve it. Now I'm lost and need someone to explain how to solve some of the questions on the assignment starting with the first one. I can work my way through some of the steps, but im confused on the first 2
Part 1: In your test program do the following:
1. Write client code (in the CoinCounterTest.java file) to create a CoinCounter object called counter.
2. Write client code to call the print method of counter.
3. Write client code to deposit 7 quarters, 3 dimes, 10 nickels, and 17 pennies in counter. Output the new status of counter using the toString method.
4. Write client code to put the value of the coins deposited so far into a double variable called totalValue. Then print totalValue with an identifying label.
5. Write client code to deposit an additional 11 quarters, 8 dimes, 0 nickels, and 100 pennies in counter. Again find out and print the value of the total deposits.
6. Write client code to create an additional CoinCounter object called bankCounter. Make deposits of 30 quarters, 90 dimes, 100 nickels, and 1000 pennies to bankCounter.
7. Write client code to print bankCounter using the print method.
8. Write client code to clear bankCounter and print bankCounter using the toString method.
Re: Help with CoinCounter method
attatched are the files needed to write the code:
CoinCounter.java
CoinCounterTest
and the Project CoinCounter
Re: Help with CoinCounter method