diff --git a/README.md b/README.md index 8ec995e..baa9e1a 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ 32 Things To Do is a to-do list application that lets students keep track of their assignments, courses and schedule. +## How to Run the Program + +From the Main.java file, compile & run the program with a Java IDE. No pre-existing data needed. + ## Register/Log In Start up the program by running the `Main.java` class in the `src/main/java` directory. diff --git a/src/main/java/use_cases/course_tracker/CourseTrackerInteractor.java b/src/main/java/use_cases/course_tracker/CourseTrackerInteractor.java index 94cfe3c..3e931fb 100644 --- a/src/main/java/use_cases/course_tracker/CourseTrackerInteractor.java +++ b/src/main/java/use_cases/course_tracker/CourseTrackerInteractor.java @@ -88,8 +88,8 @@ protected double mockGradeCalculator(ArrayList courseTasks) { for (Task task: courseTasks) { if (((Gradable) task).getGradeReceived() != -1) { - mockGrade += ((Gradable) task).getWeightage() * ((Gradable) task).getGradeReceived(); - gradedWeightage += ((Gradable) task).getWeightage(); + mockGrade += (((Gradable) task).getWeightage() / 100) * ((Gradable) task).getGradeReceived(); + gradedWeightage += ((Gradable) task).getWeightage() / 100; } } @@ -120,7 +120,7 @@ protected double requiredAverageCalculator(double goalGrade, double mockGrade, A for (Task task: courseTasks) { if (((Gradable) task).getGradeReceived() == -1) { - ungradedWeight += ((Gradable) task).getWeightage(); + ungradedWeight += ((Gradable) task).getWeightage() / 100; } } diff --git a/src/main/java/use_cases/course_tracker/progress_tracker_use_case/ProgressTrackerInteractor.java b/src/main/java/use_cases/course_tracker/progress_tracker_use_case/ProgressTrackerInteractor.java index 7b41937..74d00be 100644 --- a/src/main/java/use_cases/course_tracker/progress_tracker_use_case/ProgressTrackerInteractor.java +++ b/src/main/java/use_cases/course_tracker/progress_tracker_use_case/ProgressTrackerInteractor.java @@ -94,7 +94,7 @@ private double courseProgressCalculator(ArrayList courseTasks) { for (Task task: courseTasks) { if (task.getComplete()) { - completedWeightage += ((Gradable) task).getWeightage(); + completedWeightage += ((Gradable) task).getWeightage() / 100; } } diff --git a/src/test/java/test_course_tracker/GradeCalculatorTest.java b/src/test/java/test_course_tracker/GradeCalculatorTest.java index f95a35a..a4bdcbb 100644 --- a/src/test/java/test_course_tracker/GradeCalculatorTest.java +++ b/src/test/java/test_course_tracker/GradeCalculatorTest.java @@ -22,17 +22,17 @@ void setup() { //create some Task objects for the TaskMap Assignment assignment1 = new Assignment("testAssignment1", "testAssignment1_testStudent_testCourse", - null, 0.2); + null, 20.0); assignment1.setComplete(); assignment1.setGradeReceived(87); Assignment assignment2 = new Assignment("testAssignment2", "testAssignment2_testStudent_testCourse", - null, 0.4); + null, 40.0); assignment2.setComplete(); entities.Test test1 = new entities.Test("testTest1", "testTest1_testStudent_testCourse", null, - null, 0.3); + null, 30.0); test1.setComplete(); entities.Test test2 = new entities.Test("testTest2", "testTest2_testStudent_testCourse", null, - null, 0.1); + null, 10.0); test2.setComplete(); Event event1 = new Event("testEvent", "testEvent_testStudent_testCourse", 0, null, null, false, ""); diff --git a/src/test/java/test_course_tracker/ProgressTrackerTest.java b/src/test/java/test_course_tracker/ProgressTrackerTest.java index 00433a2..dadecf4 100644 --- a/src/test/java/test_course_tracker/ProgressTrackerTest.java +++ b/src/test/java/test_course_tracker/ProgressTrackerTest.java @@ -31,18 +31,18 @@ void setup() { //create some Task objects for the TaskMap Assignment assignment1 = new Assignment("testAssignment1", "testAssignment1_testStudent_testCourse", - null, 0.2); + null, 20.0); assignment1.setComplete(); assignment1.setGradeReceived(87); Assignment assignment2 = new Assignment("testAssignment2", "testAssignment2_testStudent_testCourse", - null, 0.4); + null, 40.0); assignment2.setComplete(); entities.Test test1 = new entities.Test("testTest1", "testTest1_testStudent_testCourse", null, - null, 0.3); + null, 30.0); test1.setComplete(); test1.setGradeReceived(66.5); entities.Test test2 = new entities.Test("testTest2", "testTest2_testStudent_testCourse", null, - null, 0.1); + null, 10.0); test2.setComplete(); Event event1 = new Event("testEvent", "testEvent_testStudent_testCourse", 0, null, null, false, "");