I have already said that constructor would’t work
Those lines in the Grades method are too long, and I have had to insert new lines to make them legible. Don’t use
tabs for indentation. That Grades() method doesn’t do what it says it does. It is doing several things, whereas a method ought to do one thing, despite what the original question said, and its name should reflect that. Grades() (apart from the capital G which is wrong) is not a helpful method name, and is close enough to the class name to cause confusion.
You ought to read the conditions in your
if blocks very very carefully.
You ought to end a series of
else if blocks with a plain
else, and make sure that the blocks are arranged in the correct order. If the 1st block isn’t appropriate, the 2nd block should be tested and then control passes to the 3rd block if the
test was
false, etc., etc. The final block should be an
else, which covers all cases which preceding blocks haven’t caught.
MB is right.
You should be doing little bits and getting them working, rather than trying to change lots of code in the hope something will work.