0

I completed the code and ran the program. I get the desired results, but when I run check I receive the following red lines:

:( input of 0.41 yields output of 4
   \ expected output, but not "Number of Coins: 4\n"

:( input of 0.01 yields output of 1
   \ expected output, but not "Number of Coins: 1\n"

:( input of 0.15 yields output of 2
   \ expected output, but not "Number of Coins: 2\n"

:( input of 1.6 yields output of 7
   \ expected output, but not "Number of Coins: 7\n"

:( input of 23 yields output of 92
   \ expected output, but not "Number of Coins: 92\n"

:( input of 4.2 yields output of 18
   \ expected output, but not "Number of Coins: 18\n"
0
3

As it says in the Problem Set 1 spec:

Incidentally, so that we can automate some tests of your code, we ask that your program’s last line of output be only the minimum number of coins possible: an integer followed by \n. Consider the below representative of how your own program should behave; highlighted in bold is some user’s input.

jharvard@appliance (~/Dropbox/pset1): ./greedy

O hai! How much change is owed?

0.41

4

Going forward, keep in mind that it is important to read all the "fine print" in the specifications.

2

You just need to output 4,not the whole phrase Number of Coins: 4 for this to work.This is just the way the Check50 program works.In writing code for other psets too, try to adhere to the format of output given in the specifications and hopefully there won't be any issue.

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