Hi all, Im having issues with this program. I've looked online and seen others that have basically the same program but have issues also. My issue is a compiling error, thats one problem thats obvious to me. This program is suppose to get the user to enter grades for five different courses and and ten different students. My compiling error is: InputGrades.java:26: illegal start of type
for (int s = 1; s <= 10; s++)
I have been working on this for the past 5 hours trying to make sense of what i have seen online and what my issues are. I have other classes that i will include if needed but for now i will just include my InputGrades class:
import java.io.*;
public class InputGrades {
private int idGrade;
private CollegeCourse[] courses = new CollegeCourse[5];
public InputGrades(int gradeID)
{
idGrade = gradeID;
courses[0] = new CollegeCourse('A', "CIS 210", 3);
courses[1] = new CollegeCourse('B', "CIS 211", 2);
courses[2] = new CollegeCourse('C', "CIS 212", 2);
courses[3] = new CollegeCourse('D', "CIS 213", 3);
courses[4] = new CollegeCourse('F', "CIS 214", 1);
}
public static void main(String[] args) throws IOException
{
InputGrades inputgrades = new InputGrades(1);
char value;
boolean match = false;
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
}
public int getCourse()
{
return courses[i];
}
for (int s = 1; s <= 10; s++)
{
System.out.println("Enter ID for student#: " + s);
}
for (int n = 1; n <= 5; n++)
{
System.out.print("\tEnter grade for course ID#" + n + ": "
+ inputGrades.courses[x].getCourseID());
value = stdin.readLine().charAt(0);
if ((value == 'A') || (value == 'B') || (value == 'C')
|| (value == 'D') || (value == 'F'))
{
match = false;
}
else
{
System.out.println("Please re-enter the grade");
match = true;
--n;
}
}
}
}
}
I would very much appreciate any help and an explanation of anything that might need it.
Thanks much,
Sam