Question: Create a program that reads the strings of students' grades and evaluates their corresponding letter grades. The program will read strings such as: firstname, lastname,

Create a program that reads the strings of students' grades and evaluates their corresponding letter grades.

The program will read strings such as: "firstname, lastname, grade1, grade2, grade3, grade4"

For example: "Charlie, Saucey, 32, 14, 24, 21"

The program needs to add the grades and then assign a letter grade, based off the following: -'A' if the sum of the grades is 90 or more -'B' if the sum of the grade is between 80 and 89 -'C' if the sum of the grades is between 70 and 79 -'D' if the sum of the grades is between 60 and 69, -'F' if the sum of the grades is 59 or less

The output should appear something like this: "firstname, lastname, letter grade"

Example program: Enter the grades of student: Carlos, Montanna, 41, 22, 11, 10 Result: Carlos Montanna (B)

Notes: Use the split method to convert the input string into a list. The list has to have exactly 6 items, otherwise, end/implement the program with an error code. Convert the grades(the last four items in the list) to integer values. Use the sum function to add the grades, which can be accessed using the slicing operator. Determine the correct letter grade based on the program, and produce the required output, understanding that the last name is at position 0, and the first name is at position 1 of the list.

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!