Forums Register Login

program error

+Pie Number of slices to send: Send
When I compile my code for MBAstudent, I get errors saying that it expected 'class' and unexpected type.
+Pie Number of slices to send: Send
Is the filename the same as the classname? If not, it should be.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
Here is the first part of the program, so what I said earlier will make more sense.
+Pie Number of slices to send: Send
And here is the second part of my program: MBAstudent
+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send

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


reply
reply
This thread has been viewed 909 times.
Similar Threads
help with noob java program
possible help, if you have the time ;-(
Problem with default '' , 0 and 0.0 being inserted into database while using JSTL.
can someone help???
Please Help!
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:35:45.