Stephen Norris
,
Ranch Hand
When I compile my code for MBAstudent, I get errors saying that it expected 'class' and unexpected type.
Jeanne Boyarsky
,
author & internet detective
staff
Is the filename the same as the classname? If not, it should be.
Stephen Norris
,
Ranch Hand
Yes, the names are the same. I have to put a check on the input from the Student class in the MBAstudent class, and I don't know how.
Stephen Norris
,
Ranch Hand
Here is the first part of the program, so what I said earlier will make more sense.
Stephen Norris
,
Ranch Hand
And here is the second part of my program: MBAstudent
Marilyn de Queiroz
,
Sheriff
staff
I see a problem in these lines:
public MBAstudent(float gp, int mat)
{
gpa = float gp;
gmat = int mat;
}
You should not be redefining gp or mat at all, much less on the right hand side of an '=' sign.
gpa = gp ;
[ November 12, 2003: Message edited by: Marilyn de Queiroz ]
Marilyn de Queiroz
,
Sheriff
staff
The if statement must be inside a method. It can't be stuck into the class just anywhere.
Also, you need another curly brace to match the one starting the if block
ln.length>0){
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com