In the Walkthrough for Greedy.c, Zamyla asked if you can spot her error:

> get amount in dollars

> while (quarters can be used)

  • increase count
  • amount decrease by a quarter

Was her order incorrect for her arguments within the while loop of the pseudocode? Should it have been the following instead?

  • amount decreases by a quarter
  • increase count

Was that the error she was asking to spot in the video? In my code I incremented the cents after I decreased the amount of the user input taken. It passes check50 and the program works through all test cases I could put it through.

1 Answer 1


Well, I don't think the error is about the order of the steps because order probably doesn't matter here.

As a hint, the error is probably about dealing with the dollar amount that you get from the user directly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .