(Bentley University Fall 2022CS 230Introduction to Programming with Python)Bentley University Fall 2022CS 230Introduction to Programming with PythonProgram 5: donor management...

1 answer below »
The Homework 4 file contains the assignment instructions. The other 2 files (donors.csv and transactions.csv) are the supporting files


( Bentley University Fall 202 2 CS 230 Introduction to Programming with Python ) Bentley University Fall 2022 CS 230 Introduction to Programming with Python Program 5: donor management sYstem The Cat Connection is an all-volunteer nonprofit organization whose primary mission is to rescue abandoned, abused, unwanted, stray, neglected, and injured cats, and to facilitate their adoption into responsible permanent homes. You volunteered to help them develop a small Python-based system that allows them to store, search, and manage their donor information. The program reads in existing donor information from a data file (donors.csv) and another file which is the donor transactions(transactions.txt). The first row is the column headings and the rest of rows are the records in each file. The program reads the information from the file to memory when it runs and writes the modified information back from memory to the file when the user exits the program. All changes to the information remain in memory while the program runs. program capabilities The program provides the following capabilities: display donors Displays all donor records in a tabular format with appropriate column headings with the columns are aligned properly. The list is sorted alphabetically by donor’s name. Use f-strings to display the donor information in the correct format. display largest amount Finds the donor(s) with the largest total donation amount. If more than one donor shares the same largest donation amount, print all their names and the largest total donation amount. Add Donor Adds a donor to the system. A donor must be added to the program before making any donation. The information required includes the donor’s first name, last name, email address, city, and state. Assuming that donor names are unique, the program will signal an error if a name is already taken. Be sure to check that the email address is in a valid format. For the purpose of this assignment, an email address is valid if it is a string that contains an @ sign and a dot (.) after the @ sign. Remove A Donor Removes a donor’s information from the system. The correct donor name must be provided. If found, the donor’s record will be deleted from the system, otherwise the program will continue to run until a donor’s name is found. add a Donation Records a donation from an existing donor. Enter the donor’s name and add the donation amount to the donor’s record. Be sure to make sure the donor exists before processing the donation, and issue an error message if the donor is not found. Quit Displays a thank-you message and saves all updated donor information to the respective files. Requirements: Your program must fulfill all the tasks outlined above. See the sample output below to get more of an idea about how the program behaves. Your prompts and formatting should match what is shown in the sample output. The two data files are on Blackboard. Make sure your program can correctly read and write information from and to the files. You may assume that all donors have distinct names. Your program must be able to handle user errors (e.g., invalid options, wrong names, invalid email address formats as described above.) For example, if a name is already in the system when adding a donor, the program should issue an error message that the name is already taken and prompt for a new name. The program should always return to the main menu after each task until the user wishes to quit. Coding Hints: You need to use dictionaries in writing this program. You can use a dictionary of lists for each file read in or a dictionary. For the donor file, the key is the donor ID and the associated values are a list containing the donor’s information, including email, city, and state and for the transactions file, the key is the donor ID and the associated values are a list containing the amount donated and the date. 1. To organize your program more effectively, you should use functions. For example, you may define a function, addDonor() to add a new donor; donate() to allow the user to make a donation, etc. Be sure to include a main() function! 2. In addition to functions for each menu item, write as many helping functions as make sense for repeated tasks such as isValidEmail(email) which returns True if the email is in a valid format · User the following standards for email address verification: · Format:  [email protected] So there should be one “@” and one “.” (There might be “.” In asomething, but we don’t consider that situation here). The index of “@” and “.” should be · Neither zero · Neither -1 · Index of the last “.” > “@” + 1 Submission Name your Python file donors.py. Test it to make sure it works with various input values. Submit it on Blackboard before the due date. Please not submit the given text files Grading 1. Your program should compile without syntax errors to receive any credit. You will receive 0 if your program does not compile. 2. Your program will be tested by a computer program before I evaluate it. The tester program is not intelligent enough to interpret the output. Therefore, for full credit, the input and output of your program need to match exactly as shown in the sample interactions. 3. As you program, I highly recommend that you save intermediate versions of the .py file each time you get a piece of the program running. This way you can always have something to submit that works on at least some of the requirements. Otherwise, what was working at one point may no longer work after further edits, and you may have no idea how to go back to the previous version (this is all too common!) 4. You will lose points if you do not include functions as described above! Submission Test your program to make sure it works. Once you have completed your homework submit it on Blackboard. Grading Your program should compile without syntax errors to receive any credit. If a part of your program is working, you will receive partial credit, but only if the program compiles without syntax errors. This assignment is scored on 50 points and contributes toward six (6) percent of your course grade. Rubric Number Criteria Points 1 Correctly read each line in each file and create appropriate data structure 10 2 Validation of user inputs for menu, existing name in donor file, adding a donation for an existing donor, and accepting both upper and lower case for the menu. 20 3 Output for menu options 1,2, and 3 match those in the assignment. 10 4 Use of symbolic constants for file names 2 5 Updated dictionaries written properly back to files 5 6 Coding style, including docstring, comments, variable names, etc. 3 Total: 50 SAMPle output Sample run #1 **************** Donor Menu ***************** 1 - Display Donors 4 - Add a Donor 2 - Display Donor Amounts 5 - Add a Donation 3 - Display Largest Amount 6 - Remove a Donor Q - Quit Enter choice: 1 Donor Names First Name Last Name: Email City State ------------------------------------------------------------------------- Heather Paul [email protected] Waltham MA Sarah Fisher [email protected] Jackson NH Debra Owen [email protected] Waltham MA Caitlin Johns [email protected] Dedham MA Nancy Parker [email protected] Dedham MA Jesus Martinez [email protected] Jackson NH Donald Johnson [email protected] Salem NH Maria Nguyen [email protected] Salem NH Mallory Rivera [email protected] Boston MA Lisa Peterson [email protected] Boston MA Tom Connors [email protected] Newton MA ========================================================================= **************** Donor Menu ***************** 1 - Display Donors 4 - Add a Donor 2 - Display Donor Amounts 5 - Add a Donation 3 - Display Largest Amount 6 - Remove a Donor Q - Quit Enter choice: 2 Donors and Amounts Donated First Name Last Name: City State Amount --------------------------------------------------------- Heather Paul Waltham MA $ 400.00 Caitlin Johns Dedham MA $ 650.50 Debra Owen Waltham MA $ 750.00 Nancy Parker Dedham MA $ 150.00 Maria Nguyen Salem NH $ 1200.00 Mallory Rivera Boston MA $ 500.00 Lisa Peterson Boston MA $ 250.00 Tom Connors Newton MA $ 500.00 ========================================================= Total Donations $ 4400.50 **************** Donor Menu ***************** 1 - Display Donors 4 - Add a Donor 2 - Display Donor Amounts 5 - Add a Donation 3 - Display Largest Amount 6 - Remove a Donor Q - Quit Enter choice: 3 The largest donation is $1200.00 from Maria Nguyen **************** Donor Menu ***************** 1 - Display Donors 4 - Add a Donor 2 - Display Donor Amounts 5 - Add a Donation 3 - Display Largest Amount 6 - Remove a Donor Q - Quit Enter choice: 4 Add a Donor Enter the first name: Sam Enter the last name: Jones Enter the email address: [email protected] Enter the city: Conway Enter the state: NH **************** Donor Menu ***************** 1 - Display Donors 4 - Add a Donor 2 - Display Donor Amounts 5 - Add a Donation 3 - Display Largest Amount 6 - Remove
Answered 2 days AfterNov 27, 2022

Answer To: (Bentley University Fall 2022CS 230Introduction to Programming with Python)Bentley...

Sathishkumar answered on Nov 29 2022
37 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here