1

I have done my pset2 but my code fails check50 even though the code is correct and encrypts the text correctly. Here is the check50 output:

:) caesar.c exists
:) caesar.c compiles
:( encrypts "a" as "b" using 1 as key
   \ expected prompt for input, not output of "Your Key is:1\nPlease provide me with t..."
:( encrypts "barfoo" as "yxocll" using 23 as key
   \ expected prompt for input, not output of "Your Key is:23\nPlease provide me with ..."
:( encrypts "BARFOO" as "EDUIRR" using 3 as key
   \ expected prompt for input, not output of "Your Key is:3\nPlease provide me with t..."
:( encrypts "BaRFoo" as "FeVJss" using 4 as key
   \ expected prompt for input, not output of "Your Key is:4\nPlease provide me with t..."
:( encrypts "barfoo" as "onesbb" using 65 as key
   \ expected prompt for input, not output of "Your Key is:65\nPlease provide me with ..."
:( encrypts "world, say hello!" as "iadxp, emk tqxxa!" using 12 as key
   \ expected prompt for input, not output of "Your Key is:12\nPlease provide me with ..."
:) handles lack of argv[1]

How do I fix this problem?

2
  • This was answered November 15. Don't necro this please. Also this is clearly different and no way similar to that thread...
    – Code
    Dec 18 '14 at 20:18
  • Variations on this question have been asked dozens and dozens of times. Every one, including this one, is answered by the canonical Q&A about how to use check50. See also: Should I vote to close old questions?
    – Air
    Dec 18 '14 at 21:23
2
:( encrypts "a" as "b" using 1 as key
   \ expected prompt for input, not output of "Your Key is:1\nPlease provide me with t..."

This means that check50 was expecting your program to ask for a value, but instead your program printed out "Your key is: _". Comment out the line that prints out "Your key is" and it should be happy. Check50 is very picky about how your code works - while you can add extra printf statements for debugging, in the end you should only print out exactly what the pset description says.

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