Question: Program (a) Rewrite program (a). Let the student has 5 subjects with certain credit hours and marks. Compute and print the GPA as example below:

 Program (a) Rewrite program (a). Let the student has 5 subjects

Program (a)

with certain credit hours and marks. Compute and print the GPA asexample below: i Courses 1 Mass Transfer 2 Heat Transfer 3 Surface

Rewrite program (a). Let the student has 5 subjects with certain credit hours and marks. Compute and print the GPA as example below: i Courses 1 Mass Transfer 2 Heat Transfer 3 Surface Chemistry 4 Fuels 5 Petrochemical Credit Hours, wi Marks Grade, G 3 54 3 75 2 82 3 65 2. 85 X=(Wix G) GPA 2-10i The output need to show gpa and all the subject, mark, grade and point 7 File Edit Search Source Run Debug Consoles Projects Tools View Help au : C:\Users\WAJAHAT ULLAH KHAN\untitled6.py Guntitled6.py* 1 -*- coding: utf-8 Created on Fri Jan 29 18:38:53 2021 36 37 38 39 40 41 42 43 44 total=0 total_hours=0 for i in range(0,4): total+=(credit_hours[i]*points[i])#given formula credit_hours *points total_hours+=credit_hours[i] #total credit hours gpa=total/total_hours #total by total credit_hours gives gpa print(round(gpa, 2)) marks=[54,75,82,65,85]#taking marks in list credit_hours=[3,3,2,3,2]#taking credit hours in list calculate_gpa(marks, credit_hours) 45 46 8. 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 def calculate_gpa(marks_list, credit_hours): points=[] gpa=0.0 for marks in marks_list:#this is for getting points based on marks if(marks >=80 and marks =75 and marks =70 and marks =65 and marks =60 and marks =55 and marks =50 and marks 40 and marks =35 and marks =33 and marks =31 and marks =0 and marks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!