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 2 of 2

Thread: Least Coins Needed For Amount class

  1. #1
    Join Date
    Oct 2011
    My Mood
    Thanked 0 Times in 0 Posts

    Default Least Coins Needed For Amount class

    Write a program that will accept a monetary amount in euro as input and compute and display the number of each coin needed to make up the amount using the least number of coins possible.
    2, 1, 50c, 20c, 10c, 5c, 2c and 1c can be used.

    I'm not sure how to write this program so any tips would be appreciated, thanks.

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Eastern Florida
    Thanked 2,465 Times in 2,416 Posts

    Default Re: Least Coins Needed For Amount class

    Do you have the algorithm for solving the problem? How would you do it manually?
    Write the steps down in pseudo code to work out the logic and then convert the pseudo code to java code.

    It'll involve division and subtraction.

Similar Threads

  1. Replies: 1
    Last Post: July 9th, 2011, 07:17 AM
  2. Trying to Give Coins For Change
    By bengregg in forum What's Wrong With My Code?
    Replies: 6
    Last Post: January 27th, 2011, 04:21 PM
  3. reading a certain amount of lines from a file?
    By welikedogs in forum What's Wrong With My Code?
    Replies: 5
    Last Post: November 3rd, 2010, 01:28 PM
  4. Vectors - accessing an unknown amount of objects
    By fox in forum Loops & Control Statements
    Replies: 1
    Last Post: May 7th, 2010, 03:54 PM
  5. Replies: 0
    Last Post: April 11th, 2010, 08:56 AM