I have create a program that you enter student information in. I think I have all the code right, but when I enter the informantion and then choose option "2" to print out the information entered the integer inputs all come back "0" apart from "StudentID'. Can someone show me where I have gone wrong and what I need to do to fix it?
Welcome to the Ranch and well done understanding the hint about your problem.
A few style things:-
1: A few of your lines are too long. Line 14 would read better as in the code below: this is how you can deal with such long lines.
2: Where you have two different names for the parameter and the field in a constructor (or a set method), give them the same name, as in my version of your constructor below. That way, you can display the best name as a parameter, and use the best name for a field. Note the construct with this.xxx. That means the field called xxx rather than the local variable/parameter xxx. You may be able to improve those field names without my help.
3: You have the Capitalletters in the wrong places in that constructor. Not Lastname but lastName please.
4: No space after ( on line 14 please.
5: There is no need for an empty line at line 24: I have removed it.
6: Your getXXX methods should have a Capital Letter after get: getGrade1 rather than getgrade1 please.
Line 69 could also benefit from breaking into several lines.
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
a bit of art, as a gift, that will fit in a stocking