Comp 151 Project 5
Working with dictionaries and functions
Summary:
In this 5th project you will open a file, load the information into a
dictionary, the let the user interact with that data. all while breaking
your code into functions.
Due:
Nov 10, 2022 at 11:59pm
Description:
Write a program consisting of at least four functions. (you can use more
if you like)
- The load_data function needs to
- open students.txt , (Each line is
of the format: - GPAs were generated by python's random number
generator.
- name|StudentNumber|credits|GPA
- read the data in,
- break each line up on the '|' character,
- create a dictionary with four keys and the data for this line as the
values for those four keys
- put each dictionary into a list
- finally return the list of dictionaries
- The print_menu function should print to command line menu. It should
have options for
- add a student
- find masters students (those with less than 25 credits)
- find students on probation (whose GPA is less than 2.0)
- find honors students (those whose GPA is greater than 3.0)
- exit the program
- The perform_command function should take a parameter for the operation
the user selected. (and any other params needed)
- Add student should
- prompt the user to enter data for a new student,
- create the dictionary
- append it to the student list
- Find Master student should
- search for all the students with fewer than 25 credits and
- print those students
- find probation should
- search for all the students with GPA <2.0 and
- print those students
- find honor students
- search for all student with a GPA greater than 3.0
- print those students
- exit
- should end the program (call exit probably)
- The main function should
- call load_data
- then in a loop
- print_menu
- get the user input
- perform_command
Other Requirements
yourNameProject5
(so mine might be JSantoreProject5)
And put the following at the beginning of
the program as a comment:
Project Submission
Submit the project by putting it on github as a private project and
making me a collaborator as before.