I need to finish it ASAP
1. Read students’ marks and Name: for each student read his/her name and then read his/her marks (first-test mark (/15), Mid-term mark (/20), Lab-test mark (/15) and Final mark (/50)).Store these data in two-dimensional parallel arrays: NAMES, MARKS.
2. Calculate the total mark for each of all students entered. Store these marks in another parallel array TOTAL.
3. Convert total marks to character grades (F, D, C, B, A). These grades will be stored in an additional parallel array GRADES.
4. Calculate and return the best mark and the before best.
5. Calculate and return the lowest mark, the before lowest mark.
6. Calculate and return the average mark between all the total marks.
7. Calculate and return the number of students getting each of these grades (F, D, C, B, A).
8. Display the students’ name with the best and before best marks.
9. Display the students’ name with the lowest and before lowest marks.
10. Display the number of students getting each of these grades (F, D, C, B, A).
11. Display the average mark between all these total marks.
Note: this what i get until this time.....
import java.io.*;
public class Students
{
static public void main (String args[ ]) throws IOException
{
int student;
int numberOfStudents = 0;
double mark, average, sum = 0;
String studentString ="";
String nameString, markString;
final String TERMINATE = "end";
final int NUMBER_OF_MARKS = 5;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("How many student's 5-mark average will you be calculating?");
numberOfStudents = getNumberFromUser();
String[] studentNames = new String[numberOfStudents];
int[] results = new int[numberOfStudents];
for(int i = 0; i< numberOfStudents; i++)// Loop 1 gets the names
{
System.out.println("What is your student's name? <Student 1 out of "+i+">");
studentNames[i] = br.readLine();
}
for(int i = 0; i< numberOfStudents; i++)// loop 2 gets the marks
{
System.out.println("Type in "+studentNames[i]+" s average one at a time <Average will be calculated>");
int total = 0;
for(int j = 0; j < NUMBER_OF_MARKS; j++ ) // inner loop to get each mark
{
total = total + getNumberFromUser();
}
results[i] = total/NUMBER_OF_MARKS;
}
for (int i = 0; i<numberOfStudents; i++)// loop 3 prints averages
{
System.out.println( studentNames[i]+ "'s 5-mark average is "+results[i]);
}
}//End Main Method
public static int getNumberFromUser() // new method to get numbers from user
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int myNumber = 0;
try
{
String fromUser = br.readLine();
myNumber = Integer.parseInt(fromUser);
}
catch(java.lang.NumberFormatException nfe)
{
System.out.print("Please enter a valid number");
return getNumberFromUser();
}
catch(java.io.IOException ioe)
{
System.out.println("Check Keybord Settings");
}
if(myNumber <1)
{
System.out.print("Please enter a valid positive number");
return getNumberFromUser() ;
}
else
{
return myNumber;
}
}
}/
but still i don't know where and how to input the calcute the grade........