https://github.com/jkirkish/Assignment-4.git
I am working on a coding project. I have to parse the student-master-list.csv File and separate the data into 3 separate CSV files. Each CSV file should contain a list of students specific to that particular course (i.e. we're grouping the students by course).
For each of the 3 CSV files, you'll need to sort the students by grade in descending order.
The CSV output file names should be called: course1.csv, course2.csv, and course3.csv. I am planning to use Bufferred Writer to create each of the three files.
I am having trouble creating my CompareTo method using Strings. Any idea on how to make compareTo method sort students by grade thru descending order and to contain a list of students specific to that particular course?
I'd consider working with grades as integers rather than strings. You can create a class
Studentto represent a student:And create a
List<Student> studentsto load the students' objects to.Then, after splitting the students to the 3 courses, you can use Streams (since Java 8) to sort each students' list: