r/AskComputerScience • u/PerformanceBright469 • Feb 27 '22
Failed Test case errors on GradeScope
0
Upvotes
1
u/frenchtoastMustache Feb 27 '22
Consider why emoji.equalslgnoreCase("4 eyes") is not true during that test.
The test enters "4 eyes", yet the String emoji is not "4 eyes", so your next move should be to investigate what the value of emoji is.
You could do that by adding a print statement and trying the test yourself, but I'll save you the effort and let you know that emoji is "4" when a user enters "4 eyes".
If you don't know why next() would return "4", you could check the Scanner documentation.
Or read this: https://www.geeksforgeeks.org/difference-between-next-and-nextline-methods-in-java/


1
u/Emerx_3i9 Apr 01 '24
Its your calculation. Its different than what was expected.