Changed how an invalid answer was handled

This commit is contained in:
2020-08-27 13:29:45 -04:00
parent 907b6fae5b
commit c40e1be88d

View File

@@ -77,16 +77,17 @@ public class Problem9 extends Problem{
} }
} }
if(!found){
throw new Unsolved("The problem was not solved!");
}
//Stop the timer //Stop the timer
timer.stop(); timer.stop();
//Throw a flag to show the problem is solved //Throw a flag to show the problem is solved
if(found){
solved = true; solved = true;
} }
else{
throw new Unsolved("The problem was not solved!");
}
}
//Reset the problem so it can be run again //Reset the problem so it can be run again
@Override @Override
public void reset(){ public void reset(){