Test cases and python program to compute the gpa of students


Question 1) Write the algorithm, test cases (with expected outputs) and the Python program to compute the GPA for an indeterminate number of students. The program would prompt the user for the following information about each student:

• student number

• number of courses taken

• for each course:

a) name of course

b) number of credit hours

c) letter grade

A student number of zero would end the input.

The output of the program would be the following information:

• For each student:

a) student number

b) number of credits taken

c) number of credits attained

d) GPA (printed with three positions after the decimal point)

e) message if student is at Dean’s list (GPA > 3.5)

• Total number of students

• Total number of students on Dean’s list

The GPA is computed by dividing total quality points (sum of the product of credit hours and numeric grade) by the number of credits taken.

The program should contain following functions:

• main: ensures multiple students

• converting letter grade: convert the letter grade (A, B+, B, C+, C, D, F) to its numeric equivalent (4.0, 3.5, 3.0, 2.5, 2.0, 1.0, 0.0)

• processing information for each student (getting data about courses, validating, computing GPA)

• printing information for each student

The program should check that the number of credits is a positive number and that a valid letter grade is entered. In either case, the program should prompt the user until valid data has been entered.

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Test cases and python program to compute the gpa of students
Reference No:- TGS04539

Expected delivery within 24 Hours