Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Spyder, write code that enables you to store any number of grades into a grades.txt plain text file. Then copy the code to to
- Using Spyder, write code that enables you to store any number of grades into a grades.txt plain text file. Then copy the code to to Jupyter notebook. (5 points)
- Using Spyder, write code that reads the grades from the grades.txt file you created in the previous sub-task. Display the individual grades and their total, count and average. Then copy the code to to Jupyter notebook (5 points)
- Using Spyder create a script for this requirement. An instructor teaches a class in which each student takes three tests. 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 students first name and last name as strings and the students three test grades as integers. Use the csv 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,test1grade,test2grade,test3grade Then copy the code to to Jupyter notebook. (5 points)
- Using Spyder create a script for this requirement. Use the csv module to read the grades.csv file from the previous exercise. Display the data in tabular format. Then copy the code to to Jupyter notebook. (5 points)
- Using Spyder create a script for this requirement. Modify your solution to the preceding exercise to create a grade report that displays each students average to the right of that students row and the class average for each test below that tests column. Then copy the code to to Jupyter notebook. (5 points)
- Using Spyder create a script for this requirement Reimplement previous sub-task using the json module to write the student information to the file in JSON format. Create a dictionary of student data in the following format: gradebook_dict = {'students': [student1dictionary, student2dictionary, ...]} Each dictionary in the list represents one student and contains the keys 'first_name', 'last_name', 'test1', 'test2' and 'test3', which map to the values representing each students first name (string), last name (string) and three test scores (integers). Output the gradebook_dict in JSON format to the file grades.json. Then copy the code to to Jupyter notebook. (5 points)
- Using Spyder create a script for this requirement. 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 students average to the right of that students three test grades and an additional row showing the class average on each test below that tests column. Then copy the code to to Jupyter notebook. (5 points)
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