develop #1

Open
Parmis_jamami wants to merge 5 commits from develop into main
Showing only changes of commit 6fc03bf1b0 - Show all commits
+14 -16
View File
@@ -25,28 +25,26 @@ public class StudentLoader extends Thread {
@Override @Override
public void run() { public void run() {
// TODO:
/*
Example line:
1001,Aryan,Computer Science,3.7
*/
for(String line : lines){ for(String line : lines){
// TODO: if( line == null || line.isBlank()) continue;
// split line
// TODO: try {
// read values
// TODO: String[] parts = line.split(",");
// create Student
// TODO:
// add to students list
int id = Integer.parseInt(parts[0].trim());
String name = parts[1].trim();
String major = parts[2].trim();
double gpa = Double.parseDouble(parts[3].trim());
students.add(new Student(id, name, major, gpa));
} catch (Exception e) {
System.err.println("Error parsing line: " + line);
}
} }
} }