What am I doing wrong?

This code is suppose to initalize the variables using a constructor while instantiating three Student objects. The Student objects should each receive five arguments including the student's first name, last name and three decimal value scores. The scores represent the grades they receive on exams. The maximum number of points is 100. The objects should calculate the average test scores for the three exams, output the average test scores and a letter grade for the average test score for each student. >90 = A, 80-89 = B, 70-79 = C, 60-69 = D <60 = FCan anyone 1. help me sort this mess out? Thanks!

{

//Declare variables

private String studentFirstName;

private String studentLastName;

private double testScore1;

private double testScore2;

private double testScore3;

private double averageScore;

//Declare variables

public String studentFirstName, studentLastName, testScore1, testScore2, testScore3, averageScore;

//instantiation of three student objects and invoke constructors

to initialize variables in the Student class

Student student1 = new Student("KayCee", "Jinkins",88.5,74.5,82.4);

Student student2 = new Student ("Fred", "Watkins",95.5,75.3,73.8);

Student student3 = new Student("Dino", "Kratz",70.5,50.5,82.0);

//Displays output to screen for each call to constructor

//calls method in Homework5

student1.writeOutput();

student2.writeOutput();

student3.writeOutput();

}//end of constructors

// definition of the constructor class with five parameters

//string, and three integers to initialize passed variables

public Student(String studentFirstName, studentLastName, double testScore1,double testScore2, double testScore3);

testScoreTotal += testScore; /***Sums all the test scores entered.***/

System.out.println("\n");

testScoreAverage = testScoreTotal / 3; /***Calculates average score.***/

{

studentFirstName = "Student's first name is: " + studentFirstName;

studentLastName = "Student's last name is: " + studentLastName;

testScore1 = "First test Score: " + testScore1;

testScore2 = "Second test Score:" + testScore2;

testScore3 = "Third test Score: " + testScore3;

averageScore = "Average Score: " + averageScore;

} //end of Student constructor

public void writeOutput()

{

System.out.println(studentFirstName);

System.out.println(studentLastName);

System.out.println(testScore1);

System.out.println(testScore2);

System.out.println(testScore3);

System.out.println(averageScore);

}//end of writeOutput method

{

int score;

char grade;

if (score >=90);

grade = 'A';

else if (score >=80);

grade = 'B';

else if (score >=70):

grade = 'C';

else if (score >=60):

grade = 'D';

else

grade = 'F';

System.out.println("Score = " + score);

System.out.println("Grade = " + grade);

}

[3088 byte] By [SoNotJavainga] at [2007-11-26 20:50:07]
# 1

what is happening to it?

please use code tags in future ( you will have to repost with the code tag in the reply box)

{

//Declare variables

private String studentFirstName;

private String studentLastName;

private double testScore1;

private double testScore2;

private double testScore3;

private double averageScore;

//Declare variables

public String studentFirstName, studentLastName, testScore1, testScore2, testScore3, averageScore;

//instantiation of three student objects and invoke constructors

to initialize variables in the Student class

Student student1 = new Student("KayCee", "Jinkins",88.5,74.5,82.4);

Student student2 = new Student ("Fred", "Watkins",95.5,75.3,73.8);

Student student3 = new Student("Dino", "Kratz",70.5,50.5,82.0);

//Displays output to screen for each call to constructor

//calls method in Homework5

student1.writeOutput();

student2.writeOutput();

student3.writeOutput();

}//end of constructors

// definition of the constructor class with five parameters

//string, and three integers to initialize passed variables

public Student(String studentFirstName, studentLastName, double testScore1, double testScore2, double testScore3);

testScoreTotal += testScore; /***Sums all the test scores entered.***/

System.out.println("\n");

testScoreAverage = testScoreTotal / 3; /***Calculates average score.***/

{

studentFirstName = "Student's first name is: " + studentFirstName;

studentLastName = "Student's last name is: " + studentLastName;

testScore1 = "First test Score: " + testScore1;

testScore2 = "Second test Score:" + testScore2;

testScore3 = "Third test Score: " + testScore3;

averageScore = "Average Score: " + averageScore;

} //end of Student constructor

public void writeOutput()

{

System.out.println(studentFirstName);

System.out.println(studentLastName);

System.out.println(testScore1);

System.out.println(testScore2);

System.out.println(testScore3);

System.out.println(averageScore);

}//end of writeOutput method

{

int score;

char grade;

if (score >=90);

grade = 'A';

else if (score >=80);

grade = 'B';

else if (score >=70):

grade = 'C';

else if (score >=60):

grade = 'D';

else

grade = 'F';

System.out.println("Score = " + score);

System.out.println("Grade = " + grade);

}

Message was edited by:

kotmfu

kotmfua at 2007-7-10 2:14:29 > top of Java-index,Java Essentials,New To Java...
# 2
if there is a compile error, what line is it occuring?
Bjava at 2007-7-10 2:14:30 > top of Java-index,Java Essentials,New To Java...
# 3
Sorry, but, I am not sure what you are talking about? I am just a beginner to both java and this forum...Please explain. Thanks
SoNotJavainga at 2007-7-10 2:14:30 > top of Java-index,Java Essentials,New To Java...
# 4
I am getting one illegal start of expression : private String Student....Identifier expected: Student1.writeoutput, Student 2.writeoutput, Student 3.writeoutput, and a whole lot of class, interface, or enum expected.
SoNotJavainga at 2007-7-10 2:14:30 > top of Java-index,Java Essentials,New To Java...
# 5
Are those the full codes? If yes, you are missing a main method. Also, you declare the same set of variables twice (once for private and once for public).
Icycoola at 2007-7-10 2:14:30 > top of Java-index,Java Essentials,New To Java...
# 6
to initialize variables in the Student classThis line is not commented out.}//end of constructorsI don't see a start to the constructor.
floundera at 2007-7-10 2:14:30 > top of Java-index,Java Essentials,New To Java...