develop #1

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