Use the python CSV module's csv.DictReader() approach to read the data from the file. Read the tab-separated file into a list of dictionaries when opening the file for reading, and use that list of dictionaries as the program runs. Before exiting, store the data back to the file using the cvs.DictWriter() so it ends up in the same tab-separated format just like the file you read. The assignment will use a menu-driven model we have often used where each option is selected by entering an integer. An image of the options you need to offer your program's user is given below. Your menu need not look identical, but should be very similar to the following. Menu options. Choose 1, 2, 3, or 4 1. Display all student data 2. Calculate a Student's Exam Average 3. Add a Sstudent 4. Save and exit
Use the python CSV module's csv.DictReader() approach to read the data from the file. Read the tab-separated file into a list of dictionaries when opening the file for reading, and use that list of dictionaries as the program runs. Before exiting, store the data back to the file using the cvs.DictWriter() so it ends up in the same tab-separated format just like the file you read. The assignment will use a menu-driven model we have often used where each option is selected by entering an integer. An image of the options you need to offer your program's user is given below. Your menu need not look identical, but should be very similar to the following. Menu options. Choose 1, 2, 3, or 4 1. Display all student data 2. Calculate a Student's Exam Average 3. Add a Sstudent 4. Save and exit
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Need to define alternative function written in Python for csv file https://bit.ly/3LCQWfD
![def Add_student(self):
student_data = []
input_str=input("enter student details- student name ,
student_data.append (input_str)
with open ('cit101.txt', 'a') as std_onj:
writerobject = csv.writer(std_obj)
writerobject.writerow(student_data)
%3D
mldterm score, final 3exam score separated by tab ")](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fb12e7222-506e-487d-a20e-061b70f8136b%2F587efb0c-176c-497d-bb2b-3fdf09659a2b%2Fmhfvit9_processed.png&w=3840&q=75)
Transcribed Image Text:def Add_student(self):
student_data = []
input_str=input("enter student details- student name ,
student_data.append (input_str)
with open ('cit101.txt', 'a') as std_onj:
writerobject = csv.writer(std_obj)
writerobject.writerow(student_data)
%3D
mldterm score, final 3exam score separated by tab ")

Transcribed Image Text:We have a text data file with 9 records. Each record has a name, a midterm score, and a final exam score. The
Global
NO
Varlables items in each row are tab-separated. The first couple of rows look like this. But, as we said, the data file
contains 9 records total.
adams
98
86
baker
92
85
carrol
59
89
and so on...
The data file you will need is given in this link: cit101.txt Clicking the link probably opens the file in your browser; save it
somewhere where you can find it. The name should remain cit101.txt. When I test your program it should be able to read my
data file, and it will if your data file is named cit101.txt.
There are example programs similar to this assignment given in the lecture notes discussing dictionaries.
Use the python CSV module's csv.DictReader() approach to read the data from the file. Read the tab-separated file into a list of
dictionaries when opening the file for reading, and use that list of dictionaries as the program runs. Before exiting, store the
data back to the file using the cvs.DictWriter() so it ends up in the same tab-separated format just like the file you read.
The assignment will use a menu-driven model we have often used where each option is selected by entering an integer. An
image of the options you need to offer your program's user is given below. Your menu need not look identical, but should be
very similar to the following.
Menu options.
1. Display all student data
2. Calculate a Student's Exam Average
3. Add a Student
4. Save and exit
Choose 1, 2, 3, or 4
Enter your choice, 1, 2, 3, or 4:
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education