The program runs as expected when I input 2 into the tester, but the test case says otherwise. Can anyone see an issue with my code because it seems to work just fine.
Best thing to do when having an issue that YOU ARE SURE is a discrepancy with the grader, is to make a separate exception in your code. In this case, Make an [if (rating == 2)] that prints the sought after response.
1
u/Pleboos Jan 27 '21
The program runs as expected when I input 2 into the tester, but the test case says otherwise. Can anyone see an issue with my code because it seems to work just fine.
1
u/[deleted] Jan 28 '21
Best thing to do when having an issue that YOU ARE SURE is a discrepancy with the grader, is to make a separate exception in your code. In this case, Make an [if (rating == 2)] that prints the sought after response.
1
u/Mrawesomemate Oct 09 '23
The reason for the error is because in the setRating method your asking if(rating <5). It should be if (newRating < 5)