Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that stores and retrieves student records. When started the program should ask the user if they would like to list students

Write a program that stores and retrieves student records. When started the program should ask the user if

Write a program that stores and retrieves student records. When started the program should ask the user if they would like to list students or add students. Use any input you'd like to represent these options (though, numbers would probably be best -- i.e. Enter 1 to list students, 2 to add student (3 to exit). Your interface should be robust and re-ask the user for data if they enter invalid data. Use exception handling to do this. If the user chooses to list the students, then read the student data file (students.txt) and display all students. Be sure to protect against issues if the file is missing; if it's missing, simply create a blank file and display that there are currently no students to list. If the user chooses to add a user, then ask the user for a first name, then last name, and then student ID, and finally, current average. Save this information in a textile called students.txt. As students are added, the file should contain information like the following (be sure that each student is represented on one line, with the fields separated by commas). Tim, Smith, 100134, 97.7 John, Doe, 120134, 71.1 Julie, Jones, 103456, 99.1 etc.. NOTE: When writing to the file, you will need to append to the file (ensuring that previous information is not overwritten).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Python import os class Student def initself firstname lastname studentid currentaverage selffirstname firstname selflastname lastname selfstudentid studentid selfcurrentaverage currentaverage def list... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java An Introduction To Problem Solving And Programming

Authors: Walter Savitch

8th Edition

0134462033, 978-0134462035

More Books

Students also viewed these Computer Network questions

Question

11. What brain mechanism enables the startle reflex to be so fast?

Answered: 1 week ago