Hello! I've got this one bit of code from a test my teacher gave me a while back, and after finishing the class, I still can't seem to find a solution to it. The following is the code from the problem:
I'm supposed to get rid of unnecessary tests in the decision structure, but I can't seem to figure out the best way to go about it. Note that we did not know arrays, vectors, class, and structs at at time, so the solution we came up with shouldn't have any of those. Any help?