Search:

Type: Posts; User: Norm

Search: Search took 0.48 seconds.

  1. Replies
    12
    Views
    1,349

    Re: I may be over-complicating this...

    Take a value and manually reduce it to the change values. Start at the big valued coins and move down to pennies. If you have 57 then 57/10 = 5 and 57&10 = 7 7/5 = 1 & 7%5 = 2

    As you do the...
  2. Replies
    12
    Views
    1,349

    Re: I may be over-complicating this...

    nickles = (nickles - 1)
    quarters = (quarters + 1)

    // can be shortened to:
    nickles--; // subtract one
    quarters++; // add one

    You need to spend more time on designing how the code should...
  3. Replies
    12
    Views
    1,349

    Re: I may be over-complicating this...

    casting a double to an int will drop the fractional parts.

    When working with money, look at using pennies instead dollars with 2 decimal points.
    This will require scaling dollars to pennies by...
  4. Replies
    12
    Views
    1,349

    Re: I may be over-complicating this...

    Look at using the /, % and - operators to solve this.
Results 1 to 4 of 4