
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
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 ")](https://content.bartleby.com/qna-images/question/b12e7222-506e-487d-a20e-061b70f8136b/587efb0c-176c-497d-bb2b-3fdf09659a2b/mhfvit9_thumbnail.png)
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 nowThis is a popular solution!
Step by stepSolved 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.Similar questions
- Computer Science Using memory-mapped I/O and polling, write a function print_string that prints a string onthe display, without using any system call. The address of the string is passed in register $a0and the string must be null-terminated. Test this function by calling it from the main function.Make sure to activate the “Keyboard and Display MMIO Simulator”.arrow_forwardgiven dt=datetime(2022,4,15,10,6,10),how can you output the datetime'format is "22/4/15" in pythonarrow_forwarduse C++ codearrow_forward
- List three classes for C++ input streams.arrow_forwardDescribe a situation that calls for using the DECODE functionarrow_forwardbinaryAddition functionThis function takes two static arrays, bit pattern length, and a third static array as its arguments. The function must populate the third array with the binary sum of the first two arrays in the given bit pattern length. Assume the first two arrays are populated with binary bits in the given bit pattern length. Moreover assume that all the arguments are valid.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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