Question: Provide a Python program to compute the weighted average grades for students and determine which student has the highest average. Provide a function that

Provide a Python program to compute the weighted average grades for students and determine which student has the highest average.

 

Provide a function that uses student name as argument. The function should display the student name and prompt the user for three grades for the student: one for the discussion, one for the quiz, and one for the programming assignment. The function should calculate the weighted average grade using the following formula and return the calculated average.

 

wtAvgGrade = discussion_grade * 0.15 + quiz_grade * 0.35+ assignment_grade * 0.5 

Give a main program that defines a list of four students. You can decide on the names of the four students. Use a for loop, to call the function successively for each student to calculate weighted average grade for each student. In addition, a check should be made to determine whether that student's grade is the highest so far. Once the loop completes, the program should display the name of the student with the highest average grade, and the corresponding weighted average grade. If more than one student has the highest grade, display the name of the first such student.

wtAvgGrade = discussion_grade * 0.15 + quiz_grade * 0.35+ assignment_grade * 0.5

Step by Step Solution

3.34 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Python program that computes the weighted average grades for students and determines which student h... View full answer

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 Programming Questions!