Skip to content

Commit

Permalink
Merge pull request #121 from hwangswan/main
Browse files Browse the repository at this point in the history
Updated the formula for 4-scale
  • Loading branch information
trhgquan authored Mar 19, 2023
2 parents 6535f97 + d6fcf57 commit 4101488
Show file tree
Hide file tree
Showing 44 changed files with 426 additions and 435 deletions.
11 changes: 1 addition & 10 deletions src/Grade.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,7 @@ const Grade &Grade::operator=(double grade) {
*
* @return Grade
*/
Grade Grade::to4Scale() const {
if (_grade < 3.0) return Grade(0.0);
if (_grade < 4.0) return Grade(1.0);
if (_grade < 5.0) return Grade(1.5);
if (_grade < 6.0) return Grade(2.0);
if (_grade < 7.0) return Grade(2.5);
if (_grade < 8.0) return Grade(3.0);
if (_grade < 9.0) return Grade(3.5);
return Grade(4.0);
}
Grade Grade::to4Scale() const { return Grade(_grade * 0.4); }

/**
* Convert grade to A scale.
Expand Down
32 changes: 16 additions & 16 deletions tests/output/1.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@ Total passed courses: 22 (78.57%)
+-------------+---------+--------------------+-------------------+-------------------+-------------+
| CSC10001 | 4 | 10.00 | 4.00 | A+ | BB |
| MTH00086 | 1 | 10.00 | 4.00 | A+ | BB |
| MTH00082 | 1 | 9.00 | 4.00 | A+ | BB |
| CSC00004 | 4 | 8.50 | 3.50 | A | BB |
| CSC10002 | 4 | 8.50 | 3.50 | A | BB |
| CSC10004 | 4 | 8.50 | 3.50 | A | BB |
| CSC10008 | 4 | 8.50 | 3.50 | A | BB |
| BIO00002 | 3 | 8.50 | 3.50 | A | TC |
| MTH00004 | 3 | 8.00 | 3.50 | A | BB |
| BAA00104 | 2 | 8.00 | 3.50 | A | BB |
| BAA00103 | 2 | 8.00 | 3.50 | A | BB |
| MTH00082 | 1 | 9.00 | 3.60 | A+ | BB |
| CSC00004 | 4 | 8.50 | 3.40 | A | BB |
| CSC10002 | 4 | 8.50 | 3.40 | A | BB |
| CSC10004 | 4 | 8.50 | 3.40 | A | BB |
| CSC10008 | 4 | 8.50 | 3.40 | A | BB |
| BIO00002 | 3 | 8.50 | 3.40 | A | TC |
| MTH00004 | 3 | 8.00 | 3.20 | A | BB |
| BAA00104 | 2 | 8.00 | 3.20 | A | BB |
| BAA00103 | 2 | 8.00 | 3.20 | A | BB |
| MTH00040 | 3 | 7.50 | 3.00 | B+ | BB |
| MTH00085 | 1 | 7.50 | 3.00 | B+ | BB |
| BAA00004 | 3 | 7.00 | 3.00 | B+ | BB |
| BIO00001 | 3 | 7.00 | 3.00 | B+ | TC |
| BAA00101 | 3 | 7.00 | 3.00 | B+ | BB |
| MTH00083 | 1 | 6.50 | 2.50 | B | BB |
| BAA00102 | 2 | 6.00 | 2.50 | B | BB |
| MTH00081 | 1 | 5.50 | 2.00 | C | BB |
| BAA00004 | 3 | 7.00 | 2.80 | B+ | BB |
| BIO00001 | 3 | 7.00 | 2.80 | B+ | TC |
| BAA00101 | 3 | 7.00 | 2.80 | B+ | BB |
| MTH00083 | 1 | 6.50 | 2.60 | B | BB |
| BAA00102 | 2 | 6.00 | 2.40 | B | BB |
| MTH00081 | 1 | 5.50 | 2.20 | C | BB |
| MTH00003 | 3 | 5.00 | 2.00 | C | BB |
| MTH00041 | 3 | 5.00 | 2.00 | C | BB |
| BAA00005 | 2 | 5.00 | 2.00 | C | TC |
+-------------+---------+--------------------+-------------------+-------------------+-------------+
| Overall | 57 | 7.61 | 3.15 | B+ | N/A |
| Overall | 57 | 7.61 | 3.04 | B+ | N/A |
+-------------+---------+--------------------+-------------------+-------------------+-------------+
Passed credit details:
Courses type BB: 49 (85.96%)
Expand Down
42 changes: 21 additions & 21 deletions tests/output/16.out
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@ Total passed courses: 28 (100.00%)
| CSC10001 | 4 | 10.00 | 4.00 | A+ | BB |
| CSC10003 | 4 | 10.00 | 4.00 | A+ | BB |
| MTH00086 | 1 | 10.00 | 4.00 | A+ | BB |
| MTH00050 | 4 | 9.50 | 4.00 | A+ | BB |
| MTH00082 | 1 | 9.00 | 4.00 | A+ | BB |
| CSC00004 | 4 | 8.50 | 3.50 | A | BB |
| CSC10002 | 4 | 8.50 | 3.50 | A | BB |
| CSC10004 | 4 | 8.50 | 3.50 | A | BB |
| CSC10008 | 4 | 8.50 | 3.50 | A | BB |
| CSC10006 | 4 | 8.50 | 3.50 | A | BB |
| BIO00002 | 3 | 8.50 | 3.50 | A | TC |
| MTH00030 | 3 | 8.50 | 3.50 | A | BB |
| CSC10009 | 2 | 8.50 | 3.50 | A | BB |
| MTH00004 | 3 | 8.00 | 3.50 | A | BB |
| BAA00104 | 2 | 8.00 | 3.50 | A | BB |
| BAA00103 | 2 | 8.00 | 3.50 | A | BB |
| BAA00003 | 2 | 8.00 | 3.50 | A | BB |
| MTH00050 | 4 | 9.50 | 3.80 | A+ | BB |
| MTH00082 | 1 | 9.00 | 3.60 | A+ | BB |
| CSC00004 | 4 | 8.50 | 3.40 | A | BB |
| CSC10002 | 4 | 8.50 | 3.40 | A | BB |
| CSC10004 | 4 | 8.50 | 3.40 | A | BB |
| CSC10008 | 4 | 8.50 | 3.40 | A | BB |
| CSC10006 | 4 | 8.50 | 3.40 | A | BB |
| BIO00002 | 3 | 8.50 | 3.40 | A | TC |
| MTH00030 | 3 | 8.50 | 3.40 | A | BB |
| CSC10009 | 2 | 8.50 | 3.40 | A | BB |
| MTH00004 | 3 | 8.00 | 3.20 | A | BB |
| BAA00104 | 2 | 8.00 | 3.20 | A | BB |
| BAA00103 | 2 | 8.00 | 3.20 | A | BB |
| BAA00003 | 2 | 8.00 | 3.20 | A | BB |
| MTH00040 | 3 | 7.50 | 3.00 | B+ | BB |
| MTH00085 | 1 | 7.50 | 3.00 | B+ | BB |
| BAA00004 | 3 | 7.00 | 3.00 | B+ | BB |
| BIO00001 | 3 | 7.00 | 3.00 | B+ | TC |
| BAA00101 | 3 | 7.00 | 3.00 | B+ | BB |
| MTH00083 | 1 | 6.50 | 2.50 | B | BB |
| BAA00102 | 2 | 6.00 | 2.50 | B | BB |
| MTH00081 | 1 | 5.50 | 2.00 | C | BB |
| BAA00004 | 3 | 7.00 | 2.80 | B+ | BB |
| BIO00001 | 3 | 7.00 | 2.80 | B+ | TC |
| BAA00101 | 3 | 7.00 | 2.80 | B+ | BB |
| MTH00083 | 1 | 6.50 | 2.60 | B | BB |
| BAA00102 | 2 | 6.00 | 2.40 | B | BB |
| MTH00081 | 1 | 5.50 | 2.20 | C | BB |
| MTH00003 | 3 | 5.00 | 2.00 | C | BB |
| MTH00041 | 3 | 5.00 | 2.00 | C | BB |
| BAA00005 | 2 | 5.00 | 2.00 | C | BB |
+-------------+---------+--------------------+-------------------+-------------------+-------------+
| Overall | 76 | 7.95 | 3.29 | B+ | N/A |
| Overall | 76 | 7.95 | 3.18 | B+ | N/A |
+-------------+---------+--------------------+-------------------+-------------------+-------------+
Passed credit details:
Courses type BB: 70 (92.11%)
Expand Down
42 changes: 21 additions & 21 deletions tests/output/17.out
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@ course code,credits,grade (10 - scale),grade (4 - scale),grade (A - scale),cours
CSC10001,4,10.00,4.00,A+,BB
CSC10003,4,10.00,4.00,A+,BB
MTH00086,1,10.00,4.00,A+,BB
MTH00050,4,9.50,4.00,A+,BB
MTH00082,1,9.00,4.00,A+,BB
CSC00004,4,8.50,3.50,A,BB
CSC10002,4,8.50,3.50,A,BB
CSC10004,4,8.50,3.50,A,BB
CSC10008,4,8.50,3.50,A,BB
CSC10006,4,8.50,3.50,A,BB
BIO00002,3,8.50,3.50,A,TC
MTH00030,3,8.50,3.50,A,BB
CSC10009,2,8.50,3.50,A,BB
MTH00004,3,8.00,3.50,A,BB
BAA00104,2,8.00,3.50,A,BB
BAA00103,2,8.00,3.50,A,BB
BAA00003,2,8.00,3.50,A,BB
MTH00050,4,9.50,3.80,A+,BB
MTH00082,1,9.00,3.60,A+,BB
CSC00004,4,8.50,3.40,A,BB
CSC10002,4,8.50,3.40,A,BB
CSC10004,4,8.50,3.40,A,BB
CSC10008,4,8.50,3.40,A,BB
CSC10006,4,8.50,3.40,A,BB
BIO00002,3,8.50,3.40,A,TC
MTH00030,3,8.50,3.40,A,BB
CSC10009,2,8.50,3.40,A,BB
MTH00004,3,8.00,3.20,A,BB
BAA00104,2,8.00,3.20,A,BB
BAA00103,2,8.00,3.20,A,BB
BAA00003,2,8.00,3.20,A,BB
MTH00040,3,7.50,3.00,B+,BB
MTH00085,1,7.50,3.00,B+,BB
BAA00004,3,7.00,3.00,B+,BB
BIO00001,3,7.00,3.00,B+,TC
BAA00101,3,7.00,3.00,B+,BB
MTH00083,1,6.50,2.50,B,BB
BAA00102,2,6.00,2.50,B,BB
MTH00081,1,5.50,2.00,C,BB
BAA00004,3,7.00,2.80,B+,BB
BIO00001,3,7.00,2.80,B+,TC
BAA00101,3,7.00,2.80,B+,BB
MTH00083,1,6.50,2.60,B,BB
BAA00102,2,6.00,2.40,B,BB
MTH00081,1,5.50,2.20,C,BB
MTH00003,3,5.00,2.00,C,BB
MTH00041,3,5.00,2.00,C,BB
BAA00005,2,5.00,2.00,C,BB
Overall,76,7.95,3.29,B+,N/A
Overall,76,7.95,3.18,B+,N/A
Passed credit details:
Courses type BB: 70 (92.11%)
Courses type TC: 6 (7.89%)
Expand Down
32 changes: 16 additions & 16 deletions tests/output/18.out
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ Total passed courses: 22 (78.57%)
+-------------+---------+--------------------+-------------------+-------------------+-------------+
| CSC10001 | 4 | 10.00 | 4.00 | A+ | BB |
| MTH00086 | 1 | 10.00 | 4.00 | A+ | BB |
| MTH00082 | 1 | 9.00 | 4.00 | A+ | BB |
| CSC00004 | 4 | 8.50 | 3.50 | A | BB |
| CSC10002 | 4 | 8.50 | 3.50 | A | BB |
| CSC10004 | 4 | 8.50 | 3.50 | A | BB |
| CSC10008 | 4 | 8.50 | 3.50 | A | BB |
| BIO00002 | 3 | 8.50 | 3.50 | A | TC |
| MTH00004 | 3 | 8.00 | 3.50 | A | BB |
| BAA00104 | 2 | 8.00 | 3.50 | A | BB |
| BAA00103 | 2 | 8.00 | 3.50 | A | BB |
| MTH00082 | 1 | 9.00 | 3.60 | A+ | BB |
| CSC00004 | 4 | 8.50 | 3.40 | A | BB |
| CSC10002 | 4 | 8.50 | 3.40 | A | BB |
| CSC10004 | 4 | 8.50 | 3.40 | A | BB |
| CSC10008 | 4 | 8.50 | 3.40 | A | BB |
| BIO00002 | 3 | 8.50 | 3.40 | A | TC |
| MTH00004 | 3 | 8.00 | 3.20 | A | BB |
| BAA00104 | 2 | 8.00 | 3.20 | A | BB |
| BAA00103 | 2 | 8.00 | 3.20 | A | BB |
| MTH00040 | 3 | 7.50 | 3.00 | B+ | BB |
| MTH00085 | 1 | 7.50 | 3.00 | B+ | BB |
| BAA00004 | 3 | 7.00 | 3.00 | B+ | BB |
| BIO00001 | 3 | 7.00 | 3.00 | B+ | TC |
| BAA00101 | 3 | 7.00 | 3.00 | B+ | BB |
| MTH00083 | 1 | 6.50 | 2.50 | B | BB |
| BAA00102 | 2 | 6.00 | 2.50 | B | BB |
| MTH00081 | 1 | 5.50 | 2.00 | C | BB |
| BAA00004 | 3 | 7.00 | 2.80 | B+ | BB |
| BIO00001 | 3 | 7.00 | 2.80 | B+ | TC |
| BAA00101 | 3 | 7.00 | 2.80 | B+ | BB |
| MTH00083 | 1 | 6.50 | 2.60 | B | BB |
| BAA00102 | 2 | 6.00 | 2.40 | B | BB |
| MTH00081 | 1 | 5.50 | 2.20 | C | BB |
| MTH00003 | 3 | 5.00 | 2.00 | C | BB |
| MTH00041 | 3 | 5.00 | 2.00 | C | BB |
| BAA00005 | 2 | 5.00 | 2.00 | C | TC |
+-------------+---------+--------------------+-------------------+-------------------+-------------+
| Overall | 57 | 7.61 | 3.15 | B+ | N/A |
| Overall | 57 | 7.61 | 3.04 | B+ | N/A |
+-------------+---------+--------------------+-------------------+-------------------+-------------+
Passed credit details:
Courses type BB: 49 (85.96%)
Expand Down
Loading

0 comments on commit 4101488

Please sign in to comment.