solution

solution.

9.3 (CLASS AVERAGE: WRITING STUDENT RECORDS TO A CSV FILE) An instructor teaches a class in which each student takes three exams. The instructor would like to store this information in a file named grades.csv for later use. Write code that enables an instructor to enter each student’s first name and last name as strings and the student’s three exam grades as integers. Use the cev module to write each record into the grades.csv file. Each record should be a single line of text in the following CSV format:

firstname, lastname, examigrade, exam2grade, exan3grade

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now
9.4 (CLASS AVERAGE: READING STUDENT RECORDS FROM A CSV FILE) Use the csv module to read the grades.csv file from the previous exercise. Display the data in tabular format.
9.5 (CLASS AVERAGE: CREATING A GRADE REPORT FROM A CSV FILE) Modify your solution to the preceding exercise to create a grade report that displays each student’s average to the right of that student’s row and the class average for each exam below that exam’s column.
9.6 (CLASS AVERAGE: WRITING A GRADEBOOK DICTIONARY TO A JSON FILE) Reimplement Exercise 9.3 using the json module to write the student information to the file in JSON format. For this exercise, create a dictionary of student data in the following format: gradebook_dict = {‘students’: [studentidictionary, student2dictionary, …]} Each dictionary in the list represents one student and contains the keys ‘first_name’, ‘last_name’, ‘examl’, ‘exam2’ and ‘exam3’, which map to the values representing each student’s first name (string), last name (string) and three exam scores (integers). Output the gradebook_dict in JSON format to the file grades.json.
9.7 (CLASS AVERAGE: READING A GRADEBOOK DICTIONARY FROM A JSON FILE) Reimplement Exercise 9.4 using the json module to read the grades.json file created in the previous exercise. Display the data in tabular format, including an additional column showing each student’s average to the right of that student’s three exam grades and an additional row showing the class average on each exam below that exam’s column.

solution

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"