Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions