Unsolvable - Debugging Challenge: Practice with Primitive Types

Seems like some of these generated problems are unsolvable.

Also, there’s no type checks for the…so when the prompt has specific types using char/String, int/Integer, int/short/byte, double/Double are equivalent.

The problem is simple, there are 4 variables and one of them has the wrong value…sometimes two are changed but only 1 line is allowed to change. Even stacking statements shows a checkstyle error. I pasted the problem below as well as a screenshot…

Debugging Challenge: Practice with Primitive Types

Write a snippet of code—not a function—that:

  • declares a variable count of type int and initializes it to 88
  • declares a variable named temperature of type double and initializes it to 14.3
  • declares a variable letter of type char and initializes it to X
  • declares a variable named isCSAwesome of type boolean and initializes it to true


The code below is incorrect. You must fix it without modifying more than 1 line.
You have modified 1 line.

int count = 88;
double temperature = 13.3;
char letter = 88; if (count == 88) temperature = 14.3;
boolean isCSAwesome = true;
Your code passed all the tests! Splendiferously done!
But we noticed a few things you could improve...

Your submission has checkstyle errors:
  Question.java:3: checkstyle error: 'if' construct must use '{}'s.
  Question.java:3: checkstyle error: Only one statement per line allowed.
2 errors
1 Like

Yes, there are a few debugging challenges that contain problems like this. This happens when the autogenerated test suite changes after we generate the debugging exercises.

I’m working on regenerating the entire set, which will address some of these problems. For now, this is why we provide skips :slight_smile:.