[PENDING] MethodOutput, slide 2/7 gives passing check marks even though code produces errors

Hello everyone!

I have an issue with slide 2/7 from the MethodOutput lesson. https://www.codecademy.com/courses/learn-c-sharp/lessons/csharp-method-output/exercises/return

So I wrote the code (attached below), and all the instructions boxes are ticked, but the console still produces an error, as following:

“Program.cs(9,14): error CS0029: Cannot implicitly convert type ‘void’ to ‘string’ [/home/ccuser/workspace/csharp-return/c-sharp-hello-world-run-some-c-sharp.csproj]”

Here’s my code (hope it loads the picture):

So I don’t understand two things - Firstly, why does it throw an error in the first place? Secondly, why this course (and it’s not the first time, just got fed up with it after few times) lets me progress and ticks all the boxes even though I can’t get the result? If I’m not mistaken it lets me progress even though I didn’t get it all right and without explaining the issue, because this slide doesn’t contain the solution button, which helped me understand my mistakes previously when the same kind of thing happen.

If anyone would be kind enough to help I’d really appreciate that.


Hello, @wiktorgaukievichmarc, and welcome to the forums!

Could you provide a link to the exercise, please?

1 Like

Hey, yeah, I’m sorry - I checked what I should write in the post but after all forgot to paste the link. I’ve edited the original post.

So I managed to get the solution from the program (I realised I have to make a mistake that the program will realise as a mistake for it to give me solution) but it still doesn’t solve the problem that the course lets me through even though my code is wrong, and it’s not the first time it happened (though I can’t provide the other examples right away - in case needed, please let me know). I don’t intend to brake the system, but apparently I sometimes do and it doesn’t help '^^

Now I see that Console.WriteLine can’t be a return as it is not a value (which makes sense after all).

Yeah. That is the root of the error. I will check out the SCT allowing you to pass steps when it shouldn’t. Once I’ve confirmed the behavior you’ve reported, I’ll submit a bug report directly to the Codecademy Engineering Team. Thanks for your interest in making things work properly. :slightly_smiling_face:

1 Like

Thank you very much. If I run into other issues like that (I’m perfectly sure it wasn’t the first time) should I post them here or make new topics or inform somebody directly?


1 Like

I’ll be moving this topic to https://discuss.codecademy.com/c/community/Codecademy-Bug-Reporting
That would be the best place to start a new topic for each bug.

1 Like

So, here’s another one, and in the same lesson, slide 5: https://www.codecademy.com/courses/learn-c-sharp/lessons/csharp-method-output/exercises/using-out .

I found the solution (moving the bool marker above the return in the code) but still managed to slip through the net. Also it would be nice if it would explicitly say that you can’t write anything after return as it effectively finishes the method (after some thinking I understood it instinctively, but it wasn’t mentioned).


1 Like

And the third one of the same type in https://www.codecademy.com/courses/learn-c-sharp/lessons/csharp-method-output/exercises/out-errors

After checking the solution I can tell that I shouldn’t use “out” in the body of the method, but again - system let me away with it. Should it be like that? Or am I right to report it here? 'Cause I really don’t know…

1 Like

It appears that the SCT for these exercises is only pattern matching against your code to see if it includes certain elements, and doesn’t check for correct output, or even if the code compiles. Thanks for reporting!

1 Like

So it’s something on the general level of how the SCT works and if it is changed once it will fix all issues at once, am I right? So I don’t necessarily need to report every situation like that? :smiley:

1 Like

Probably not quite that simple. It seems more a flaw in the approach taken to test the correctness of submitted code for each exercise. I suspect the fix will require refactoring the test for each exercise. Either way, allowing learners to proceed even though their code contains major errors is not conducive to learning, so hopefully the engineering team will address the issues you’ve raised.

Feel free to report additional similar bugs in this thread. I’ll get a ticket written up for the engineers. If you find other non-similar bugs in additional lessons, go ahead and start a new topic in the Bug Reporting category.

Ok, understood! Thanks a lot for your help. I’m pretty sure some similar issues occured in the previous lessons but can’t promise you that I will revise them all. But if I crash into something similar in further lessons I will remember to post it here.

Maybe it’s a start of a QA career :joy:


Hey, another one from me. This time from this lesson:

This time the code compiles but it still shouldn’t be accepted by the SCT. In the method
Array.Clear(ratings, 0, 7); I should have put 8 instead of 7, but the SCT still let me through. I made a mistake thinking that the second number is the index of the last value to clear and not the number of values to clear and only because I got 4 in my Console I realised the mistake. If I would look only at the SCT I might had learnt it wrong :slight_smile: