0

hey im looking to see if any one can help me out with this

:) greedy.c exists
:) greedy.c compiles
:( input of 0.41 yields output of 4
   \ expected output, but not "4 coins owed"
:( input of 0.01 yields output of 1
   \ expected output, but not "1 coins owed"
:( input of 0.15 yields output of 2
   \ expected output, but not "2 coins owed"
:( input of 1.6 yields output of 7
   \ expected output, but not "7 coins owed"
:( input of 23 yields output of 92
   \ expected output, but not "92 coins owed"
:( input of 4.2 yields output of 18
   \ expected output, but not "18 coins owed"
:) rejects a negative input like -.1
:) rejects a non-numeric input of "foo"
:) rejects a non-numeric input of ""

i dont understand why i have the numbers i need but the check still wont work

1

The answer is simple, just not obvious. Your output contains extraneous data, coins owed.

check50 does all the grading, not a person, so there's no room for variance. check50 expects exact output. If there are any extra or missing comments, characters, prompts, punctuation, whitespace, linefeeds, or anything that isn't expected, it's going to fail.

It has to be automated because there are thousands of people taking the class all the time and there simply wouldn't be enough resources to do it any other way for free.

One of the hidden lessons of this course is this. When given a programming task, write the code to do EXACTLY what the specification requires, nothing more, and nothing less. This is especially important in team programming, where each person or group is writing a part of the project that has to work with other pieces later. While changes can be suggested and discussed in the design phase, once the spec is finalized, everyone has to write to that spec. If not, the pieces don't work together later.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

1
  • thank you i got it fixed
    – junekaur
    Apr 4 '16 at 15:53
0

the checker program wants this specific arrangement of characters between the quotation marks. Took me about 15 minutes to figure out that it DOES want a line break but does NOT want a space

printf("%d\n" , q + d + n + p);

You must log in to answer this question.

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