From db20dcde472794ca0c3ad0593dc6c5ac67937723 Mon Sep 17 00:00:00 2001 From: jetbangs <61312802+jetbangs@users.noreply.github.com> Date: Tue, 9 Mar 2021 20:15:59 -1100 Subject: [PATCH 1/3] Add files via upload --- .../ENG1XXXXXX/ENG1603884/gp calculator.py | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 submissions/ENG1XXXXXX/ENG1603884/gp calculator.py diff --git a/submissions/ENG1XXXXXX/ENG1603884/gp calculator.py b/submissions/ENG1XXXXXX/ENG1603884/gp calculator.py new file mode 100644 index 0000000..e1ede57 --- /dev/null +++ b/submissions/ENG1XXXXXX/ENG1603884/gp calculator.py @@ -0,0 +1,43 @@ +''''This code calculates the cgpa of students''' + +print('Enter the total number of courses you offer:') +course_number = int(input()) + +# creates empty lists to store the inputs from the users +courses = [] +grade_points = [] +credit_points = [] +sub_totalList = [] + + +for a in range(course_number):#a loop that loops according to the number of courses offered + + + def convertGrade(grade):#function that converts the grade of the student to grade points + if grade == 'A' or grade == 'a': + return 5 + elif grade == 'B' or grade == 'b': + return 4 + elif grade == 'C' or grade == 'c': + return 3 + elif grade == 'D' or grade == 'd': + return 2 + elif grade == 'F' or grade == 'f': + return 0 + + print('Enter the course code:') + course = input() + courses.append(course)#adds the input to the course list + print('Enter the course credit:') + credit = int(input()) + credit_points.append(credit)#adds input to the credit_points list + print('Enter your grade for the course:') + grade = input() + convertGrade(grade)#the function to convert the grades is called + sub_total = convertGrade(grade)*credit + sub_totalList.append(sub_total)#adds input to the sub_totalList list + grade_points.append(grade)#adds input to the grade_points list + + +gpa = sum(sub_totalList)/sum(credit_points)#gpa formula +print("Your GP is " + gpa) From 3527bd960f9039be169cda8025c538a46536bc00 Mon Sep 17 00:00:00 2001 From: jetbangs <61312802+jetbangs@users.noreply.github.com> Date: Tue, 9 Mar 2021 20:18:09 -1100 Subject: [PATCH 2/3] Add files via upload --- submissions/ENG1603884/gp calculator.py | 43 +++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 submissions/ENG1603884/gp calculator.py diff --git a/submissions/ENG1603884/gp calculator.py b/submissions/ENG1603884/gp calculator.py new file mode 100644 index 0000000..e1ede57 --- /dev/null +++ b/submissions/ENG1603884/gp calculator.py @@ -0,0 +1,43 @@ +''''This code calculates the cgpa of students''' + +print('Enter the total number of courses you offer:') +course_number = int(input()) + +# creates empty lists to store the inputs from the users +courses = [] +grade_points = [] +credit_points = [] +sub_totalList = [] + + +for a in range(course_number):#a loop that loops according to the number of courses offered + + + def convertGrade(grade):#function that converts the grade of the student to grade points + if grade == 'A' or grade == 'a': + return 5 + elif grade == 'B' or grade == 'b': + return 4 + elif grade == 'C' or grade == 'c': + return 3 + elif grade == 'D' or grade == 'd': + return 2 + elif grade == 'F' or grade == 'f': + return 0 + + print('Enter the course code:') + course = input() + courses.append(course)#adds the input to the course list + print('Enter the course credit:') + credit = int(input()) + credit_points.append(credit)#adds input to the credit_points list + print('Enter your grade for the course:') + grade = input() + convertGrade(grade)#the function to convert the grades is called + sub_total = convertGrade(grade)*credit + sub_totalList.append(sub_total)#adds input to the sub_totalList list + grade_points.append(grade)#adds input to the grade_points list + + +gpa = sum(sub_totalList)/sum(credit_points)#gpa formula +print("Your GP is " + gpa) From e3e0ae6c8dce21335dc0cd0cdfbcff5561c66c1a Mon Sep 17 00:00:00 2001 From: jetbangs <61312802+jetbangs@users.noreply.github.com> Date: Tue, 9 Mar 2021 20:18:46 -1100 Subject: [PATCH 3/3] Delete submissions/ENG1XXXXXX/ENG1603884 directory --- .../ENG1XXXXXX/ENG1603884/gp calculator.py | 43 ------------------- 1 file changed, 43 deletions(-) delete mode 100644 submissions/ENG1XXXXXX/ENG1603884/gp calculator.py diff --git a/submissions/ENG1XXXXXX/ENG1603884/gp calculator.py b/submissions/ENG1XXXXXX/ENG1603884/gp calculator.py deleted file mode 100644 index e1ede57..0000000 --- a/submissions/ENG1XXXXXX/ENG1603884/gp calculator.py +++ /dev/null @@ -1,43 +0,0 @@ -''''This code calculates the cgpa of students''' - -print('Enter the total number of courses you offer:') -course_number = int(input()) - -# creates empty lists to store the inputs from the users -courses = [] -grade_points = [] -credit_points = [] -sub_totalList = [] - - -for a in range(course_number):#a loop that loops according to the number of courses offered - - - def convertGrade(grade):#function that converts the grade of the student to grade points - if grade == 'A' or grade == 'a': - return 5 - elif grade == 'B' or grade == 'b': - return 4 - elif grade == 'C' or grade == 'c': - return 3 - elif grade == 'D' or grade == 'd': - return 2 - elif grade == 'F' or grade == 'f': - return 0 - - print('Enter the course code:') - course = input() - courses.append(course)#adds the input to the course list - print('Enter the course credit:') - credit = int(input()) - credit_points.append(credit)#adds input to the credit_points list - print('Enter your grade for the course:') - grade = input() - convertGrade(grade)#the function to convert the grades is called - sub_total = convertGrade(grade)*credit - sub_totalList.append(sub_total)#adds input to the sub_totalList list - grade_points.append(grade)#adds input to the grade_points list - - -gpa = sum(sub_totalList)/sum(credit_points)#gpa formula -print("Your GP is " + gpa)