0

I'm trying to check my greedy program with check50. I'm wondering whether my output must match the one required per the pset specification page.

Here's check50's output

jharvard@appliance (~/Dropbox/pset1): ./greedy
enter the amount(non-negative value) that should be return 
.34
the amount is 34The number of coins are 
1 Quarter , 0 dime , 1 nickle , 4 penny = total coins are 6 
jharvard@appliance (~/Dropbox/pset1): check50 2014/x/pset1/greedy greedy.c
:) greedy.c exists
:) greedy.c compiles
:( input of 0.41 yields output of 4
   \ expected output, but not "the amount is 41 \n\n The number of coi..."
:( input of 0.01 yields output of 1
   \ expected output, but not "the amount is 1 \n\n The number of coin..."
:( input of 0.15 yields output of 2
   \ expected output, but not "the amount is 15 \n\n The number of coi..."
:( input of 1.6 yields output of 7
   \ expected output, but not "the amount is 160 \n\n The number of co..."
:( input of 23 yields output of 92
   \ expected output, but not "the amount is 2300 \n\n The number of c..."
:( input of 4.2 yields output of 18
   \ expected output, but not "the amount is 420 \n\n The number of co..."
:) rejects a negative input like -.1
:) rejects a non-numeric input of "foo"
:) rejects a non-numeric input of ""
https://sandbox.cs50.net/checks/8cc408e358104ca79aaee011d6b13c88 

1 Answer 1

3

check50 is a program like any other program. Computers are not smart enough to understand things (unless we, programmers, teach them to do so). Unfortunately, check50 is not yet taught to understand every single possible different output. That's why it's required per the pset specification page that your output must match a specific sample in order for check50 to be able to check it.

So the answer is yes, your program's output must match the sample required per the pset specification page. Otherwise, and even if your program outputs the correct results, it won't pass check50 tests because imagine it expects to find the number

10

by itself, but rather it finds

the number of coins is 10
3
  • I m facing the same very problem despite of having the same sample format, what could b wrong?
    – user1481
    Commented Jul 25, 2014 at 5:00
  • @user1481 are you sure your program outputs the correct results and a newline character after the output? If yes, you may send me your source code at [email protected] to see if I can help you identify the bug!
    – kzidane
    Commented Jul 25, 2014 at 9:58
  • I would post this question to the CS50 staff if it is class or grade related. If it a technical question then Kareem gave you the answer
    – Mo1
    Commented Aug 8, 2014 at 1:31

You must log in to answer this question.

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