Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Help with CoinCounter method

  1. #1
    Junior Member
    Join Date
    Sep 2009
    Thanked 0 Times in 0 Posts

    Default 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.
    Attached Files Attached Files

  2. #2
    Junior Member
    Join Date
    Sep 2009
    Thanked 0 Times in 0 Posts

    Default Re: Help with CoinCounter method

    attatched are the files needed to write the code:

    and the Project CoinCounter

  3. #3
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    United Kingdom
    My Mood
    Thanked 293 Times in 226 Posts
    Blog Entries

    Default Re: Help with CoinCounter method

    What Is an Object? (The Java™ Tutorials > Learning the Java Language > Object-Oriented Programming Concepts)

    Please post some of the code you have written and we can take it from there..
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

Similar Threads

  1. Any way to map method calls?
    By Swiftslide in forum Collections and Generics
    Replies: 1
    Last Post: September 21st, 2009, 04:37 AM
  2. dynamic method problem...
    By Ranger-Man in forum Object Oriented Programming
    Replies: 8
    Last Post: September 7th, 2009, 04:22 PM
  3. [SOLVED] Method declaration in Java
    By mohsendeveloper in forum Object Oriented Programming
    Replies: 4
    Last Post: June 11th, 2009, 03:18 AM
  4. [SOLVED] Problem in Coin-counter with scanner class
    By coccoster in forum File I/O & Other I/O Streams
    Replies: 6
    Last Post: March 25th, 2009, 08:46 AM
  5. Replies: 1
    Last Post: December 30th, 2008, 07:30 AM