Hello everyone! So I'm pretty new at all this java programming and I'm having some difficulty in one of my college classes. I have an assignment that I need to program for. I kind of have a start but don't really know where to go from there. I'm going to attach the assignment directions and then maybe someone can help me. Ill also attach what I already have as well.
Assignment Directions.....
You will need to do the following:
1) prompt for the student grade file (see Grades.txt for a clean sample)
2) process the file to determine the following pieces of information to be
provided as a summary after processing
a) Number of student records processed
b) Number of assignments graded (distinct assignments, 1 test for 18 students
is 1 assignment)
c) Total possible points
d) Show each student number with total points for student, grade as percent
of total possible (rounded to single decimal place) and an indicator (like
*****) if the student record is incomplete (i.e. missing a grade, 0 is not
missing, blank (i.e. empty string) is missing)
e) Average grade per assignment and average total grade
f) Highest grade per assignment and highest total grade (show student number
for each highest grade)
Your first stage is to create psuedo-code that details how you will go about solving this problem.
It should contain sufficient detail, noting the following: prompting for the file, when to open the file, loop structures (don't worry about the expressions, etc. for loops, just indicate where, if nested, etc.) and start thinking about what variables will be needed to keep track of the different values necessary to complete the requirements.
This is what I have...
import java.util.Scanner; import java.io.*; import java.util.Random; import java.util.ArrayList; public class GradesAssignment { /** * @param args */ public static void main(String[] args) throws I0Exception { Scanner keyboard = new Scanner(System.in); System.out.println("Please enter the filename (full path)"); String path = keyboard.nextLine(); File gradeFile = new File(path); while (! gradeFile.exists()); { System.out.println("Sorry that file does not exist, please enter the filename (full path)"); path= keyboard.nextLine(); gradeFile = new File(path); } Scanner fileReader = new Scanner(gradeFile); ArrayList<String> rows = new ArrayList<String>(); while(fileReader.hasNextLine()) { rows.add(fileReader.nextLine()); } fileReader.close(); System.out.println("Number of students: " + ( rows.size()-1)); String headerRow = rows.get(0); String [] columns = headerRow.split("/t");