Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 7 : Grade Database In this problem, you will be displaying ( fictional ) grade information that is assumed to be taken from a
Problem : Grade Database
In this problem, you will be displaying fictional grade information that is assumed to be taken from a university's grade
database. The information is stored in two dictionaries and three lists, as shown below.
Copy the code below into a code cell, and then execute that cell.
students
:first:'Brendan', 'last':'Small'
:first:'Melissa', 'last':'Robbins'
:first:'Jason', 'last':'Penopolis'
:first:'Fenton', 'last':'Mulley'
courses
'ENGL :'Composition I
'ENGL :'Composition II
'MATH :'College Algebra',
'MATH :'Calculus I
'CHEM :'General Chemistry I
'ECON :'Macroeconomics'
sid
cid ENGL 'MATH 'ENGL 'CHEM 'MATH 'ECON
'ENGL 'ENGL 'CHEM 'ENGL 'MATH 'MATH
grade DCBABC
AFBAAC
The students dictionary is a lookup table that allows you to obtain the name of a student based on their Student ID
number. The courses dictionary is a lookup table that allows you to obtain the name of a course based on the Course ID
which consists of a department name and course number The lists sid, cid, and grade are parallel lists that represent
columns from a grade database. The sid list contains student ID numbers associated with different records form the
database, the cid list contains course ID information for the records, and the grade list contains the grade obtained by
the corresponding student in the corresponding course.
Use a loop to print a table displaying the twelve records. The table should be formatted as follows:
The first row of output should contain column headers.
The second row should be a dividing line consisting of dashes.
The table should have columns for student ID first name, last name, course id course name, and grade.
The number of characters reserved for each column should be and in that order
All columns should be leftaligned except for the grade column, which should be rightaligned.
The first few rows rows of the output are shown below. Try to match the format of this output exactly.
SID First Last CID Course Name Grade
Jason Penopolis ENGL Composition I D
Brendan Small MATH College Algebra C
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started