money

This is a discussion on money within the C++ Programming forums, part of the General Programming Boards category; Need help Write a program that calculates the number of quarters, dimes, nickels, and pennies necessary to generate the number ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    126

    money

    Need help


    Write a program that calculates the number of quarters, dimes, nickels, and pennies necessary to generate the number of cents entered as input. For example, if 93 cents is entered as input, the program should indicate that three quarters, one dime, one nickel, and three pennies are necessary to add up to 93 cents.

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    194
    I'll give you some helpful hints.

    If you were to make change for a person in real life how would you do it?
    Start with quarters the biggest unit.
    How many do you need?
    Work your way down till you get to pennys.

    Start with some pencil and paper and write down instructions on how to give change. Go step by step. Then you can turn those instructions into code. Pretend the instructions are for a robot, and make them very explicit, and dont assume anything. Thats basicly what coding this is, telling the robot aka the computer what to do.

  3. #3
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744
    Please try it first. If you're stuck post some code

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Money problem
    By Tesnik in forum C++ Programming
    Replies: 6
    Last Post: 08-24-2007, 08:12 AM
  2. How the rich get rich [Long]
    By nickname_changed in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 05-05-2005, 10:36 PM
  3. Another Coin Counting Program
    By MipZhaP in forum C++ Programming
    Replies: 4
    Last Post: 01-21-2005, 01:02 AM
  4. Money classs
    By blackjs in forum C++ Programming
    Replies: 5
    Last Post: 12-04-2001, 09:43 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21