int exceptionTrap(int a) {
try {
exceptionThrower(a);
} catch (FineException fe) {
return 1;
} catch (CoarseException ce) {
return 0;
}
return -1;
}
You're saying the above is invalid? Tests out perfectly fine on my system...are you trying to say there shouldn't be the last return because you say "You may assume that an exception is always thrown"? If a function returns a type of int, all codepaths then need to return a type of int, programming 101.Others indeed do have some errors as I quickly typed them up (off by 1, forgetting that java array length isn't the same as C++ std::vector.size). Number 3 could definitely use a better example, such as a = 12 (so the result would be {12, 11, 10}.
I admit, I checked number 2 closely, saw a horribly invalid failure reported and only glanced over the rest. Independent of the other failures, you cannot have incorrectly graded questions, and the rest of the points still stand, the requester has nothing to compare against, leaving the judgement up to your pass/fail (which is clearly not 100%) and the random assignment of questions to different test takers results in no real comparison ability between skills.