C++ Programming Help!
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: C++ Programming Help!

  1. #1
    Join Date
    Mar 2013
    Posts
    1

    C++ Programming Help!

    Please build this program for me so I can dissect it and study each line!

    Write a C++ program to calculate the fewest number of each denomination needed to pay a bill of amount TOTAL. For example, if the end user enters $97 for TOTAL, program will output that the bills would consist of one $50 bill, two $20 bills, one $5 bill, and two $1 bills. (Assume that the amount is in whole dollars, no cents, and only $100, $50, $20, $10, $5, and $1 denominations are available.) Aid: You may want to use the modulus operator %.

  2. #2
    Join Date
    Dec 2012
    Location
    England
    Posts
    1,990

    Re: C++ Programming Help!

    We don't write your homework for you! Please read http://forums.codeguru.com/showthrea...ork-assignment.

    If you try to write a program for this problem and post the code here, we'll give you advice about it but you need to write it first. If you post code, please use code tags (go advanced, select code, click '#')
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  3. #3
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,005

    Re: C++ Programming Help!

    Quote Originally Posted by epoon317 View Post
    Please build this program for me so I can dissect it and study each line!

    Write a C++ program to calculate ...
    So how much are you going to pay for such a work made for you?
    And if you are read to pay then please, move your post to the correspondent Forum (like Open Positions (Jobs))

    If you are not going to pay then you'll need to do your work yourself, and 2kaud already wrote how it could be done.
    Victor Nijegorodov

  4. #4
    Join Date
    Apr 1999
    Posts
    27,418

    Re: C++ Programming Help!

    Quote Originally Posted by epoon317 View Post
    Please build this program for me so I can dissect it and study each line!
    If you want to "study each line", then why this specific example? Why not another example? C++ is C++, regardless of what the program is supposed to do, so if you really wanted to "study each line", then you would get any C++ program and "study it". So in truth, this is really homework, isn't it?

    Forget about C++ for the moment. Do you know how to calculate the fewest number of bills, regardless of whether you know C++ or not? What if someone asked you to write down the steps to get you the fewest number of bills. Can you do that? If you can, then you translate those steps into a program. If you don't know the steps to figure out the problem, then that is where you start.

    Regards,

    Paul McKenzie

  5. #5
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    11,978

    Re: C++ Programming Help!

    Here you go.

    Code:
    for(;P("\n"),R--;P("|"))for(e=C;e--;P("_"+(*u++/8)%2))P("| "+(*u/4)%2);

  6. #6
    Join Date
    Dec 2012
    Location
    England
    Posts
    1,990

    Re: C++ Programming Help!

    Interesting display for output!
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center