Help on a programs error messages

Asked By 20 points N/A Posted on -
qa-featured

Hi experts I am receiving the following subsequent syntax messages:

illegal start of expression public void display menu()
(with arrow pointing to the 'p')
and also
';' expected } (with arrow also pointing to the })
This is my code which causes the  error message:
public class InsyStudent extends Student
{
public InsyStudent( String fName, String lName, String ssn )
{
int midTerm;
int finalExam;
int researchProject;
int presentationScore;
public void display_menu()
{
System.out.println( "1) INSY 3305n2) INSY 3305n3) INSY 4304");
System.out.println("4) INSY 4305n5) INSY 4310n6) INSY 4320n" );
}
This is my code for the last error message:
public String toString()
{
return String. format( "%s %st%  s", super. To String (), select Course() );
}
}
What should I do? Please help.


Thanks a lot.

SHARE
Best Answer by Tunacao_Caaron1
Best Answer
Best Answer
Answered By 10 points N/A #106757

Help on a programs error messages

qa-featured

Hey Alec hughes!

Well I have checked the whole query you written above. I have noticed two things in it.

First thing is that you have not checked the braces properly because your constructors are not properly closed.

Second thing I noticed is THE arguments. If you watch above closely you will notice that there are three arguments in your template string but you have supplied only two arguments.

That is the reason you are getting this error.

Check it twice and remove the mistakes you will not face this error anymore.

Hope it will help you in the future.

Thanks.

Answered By 0 points N/A #106760

Help on a programs error messages

qa-featured

 

Hello Alec,
 
 
It would be great if you post the entire code here. Never mind, I inspected the code you have written closely and straight away found out the error in the scopes. Check the combination of open and close scopes in the constructor's scopes. 
 
Also check the arguments you have parsed to the constructor. It expects three arguments where you supply only two. 
 
Hope that would fix this syntax error! 

 

 

Login/Register to Answer

Related Questions