Question: Starter Code: Declare and initialize a 2 - D list with data in the given table gradebook = [ [ Student Name,Math,Science,History ] ,

Starter Code: Declare and initialize a 2-D list with data in the given table
gradebook =[["Student Name","Math","Science","History"],
["John Doe",85,90,78],
["Jane Smith",92,88,95],
["Alice Johnson",76,82,80],
["Bob Brown",89,94,85],
["Charlie Green",67,72,78],
["Diana White",94,91,88],
["Evan Black",81,85,79],
["Fiona Blue",75,70,84],
["George Red",88,92,90],
["Holly Yellow",79,84,86]] In the script, do the following:
a) Print the table with proper alignment. Make sure to include the header for each column to show what
the column is about (see sample output below).
b) Calculate the average score over the 3 courses for each student and print it as an extra column to the
right of the table. Keep 2 digits after the decimal point for floating-point values.
c) Based on the average score of each student, calculate their letter grade and print it as an extra column
to the right of the table.
Use the following grading scale for conversion:
Average Score Letter Grade
>=90 and <=100 A
>=80 and <90 B
>=70 and <80 C
>=60 and <70 D
Below 60 F
d) For each course, calculate the average score of the entire class, and print them as an extra row at the
bottom of the table. Keep 2 digits after the decimal point for floating-point values.
4. Submit your completed CS1300_A5.py file on Canvas.
Note that:
- You can do everything in the main program, or write your own functions if necessary (not required),
but you must use the given starter code to begin.
- You may use any of the Python class methods as well as other built-in functions, but NOT any
internal or external packages (i.e. no import statement is allowed in your script).
- Please include comments throughout the body of your program to explain what the code is doing.
Furthermore, if you write functions, please include documentation for each function using docstrings.
- You are expected to use repetition statements whenever possible. For instance, if you manually add
up the values in a column using a large addition expression, it will be considered hardcoding. You can
refer to Ch.7 of the class notes regarding how to iterate over a multi-dimensional 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 Programming Questions!