Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

( 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...

1 answer below »
(
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 co
ect 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 Dono
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 e
or 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 Dono
Removes a donor’s information from the system. The co
ect 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 e
or 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 co
ectly 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 e
ors (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 e
or 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 XXXXXXXXXXto 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:   XXXXXXXXXX
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 e
ors 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 e
ors 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 e
ors. This assignment is scored on 50 points and contributes toward six (6) percent of your course grade.
Ru
ic
    Numbe
    Criteria
    Points
    1
    Co
ectly 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 XXXXXXXXXXAdd a Dono
2 - Display Donor Amounts XXXXXXXXXXAdd a Donation
3 - Display Largest Amount XXXXXXXXXXRemove a Dono
Q - Quit
Enter choice: 1
XXXXXXXXXXDonor Names
First Name Last Name: Email XXXXXXXXXXCity State
-------------------------------------------------------------------------
Heather XXXXXXXXXXPaul XXXXXXXXXX XXXXXXXXXX XXXXXXXXXXWaltham MA
Sarah XXXXXXXXXXFisher XXXXXXXXXX XXXXXXXXXX Jackson NH
De
a XXXXXXXXXXOwen XXXXXXXXXX XXXXXXXXXX XXXXXXXXXXWaltham MA
Caitlin XXXXXXXXXXJohns XXXXXXXXXX XXXXXXXXXX XXXXXXXXXXDedham MA
Nancy XXXXXXXXXXParker XXXXXXXXXX XXXXXXXXXX XXXXXXXXXXDedham MA
Jesus XXXXXXXXXXMartinez XXXXXXXXXX XXXXXXXXXXJackson NH
Donald XXXXXXXXXXJohnson XXXXXXXXXX XXXXXXXXXX Salem NH
Maria XXXXXXXXXXNguyen XXXXXXXXXX XXXXXXXXXX Salem NH
Mallory XXXXXXXXXXRivera XXXXXXXXXX XXXXXXXXXX Boston MA
Lisa XXXXXXXXXXPeterson XXXXXXXXXX XXXXXXXXXXBoston MA
Tom XXXXXXXXXXConnors XXXXXXXXXX XXXXXXXXXX XXXXXXXXXXNewton MA
=========================================================================
**************** Donor Menu *****************
1 - Display Donors XXXXXXXXXXAdd a Dono
2 - Display Donor Amounts XXXXXXXXXXAdd a Donation
3 - Display Largest Amount XXXXXXXXXXRemove a Dono
Q - Quit
Enter choice: 2
XXXXXXXXXXDonors and Amounts Donated
First Name Last Name: City State Amount
---------------------------------------------------------
Heather XXXXXXXXXXPaul XXXXXXXXXXWaltham MA $ XXXXXXXXXX
Caitlin XXXXXXXXXXJohns XXXXXXXXXXDedham MA $ XXXXXXXXXX
De
a XXXXXXXXXXOwen XXXXXXXXXXWaltham MA $ XXXXXXXXXX
Nancy XXXXXXXXXXParker XXXXXXXXXXDedham MA $ XXXXXXXXXX
Maria XXXXXXXXXXNguyen XXXXXXXXXXSalem NH $ XXXXXXXXXX
Mallory XXXXXXXXXXRivera XXXXXXXXXXBoston MA $ XXXXXXXXXX
Lisa XXXXXXXXXXPeterson Boston MA $ XXXXXXXXXX
Tom XXXXXXXXXXConnors XXXXXXXXXXNewton MA $ XXXXXXXXXX
=========================================================
Total Donations $ XXXXXXXXXX
**************** Donor Menu *****************
1 - Display Donors XXXXXXXXXXAdd a Dono
2 - Display Donor Amounts XXXXXXXXXXAdd a Donation
3 - Display Largest Amount XXXXXXXXXXRemove a Dono
Q - Quit
Enter choice: 3
The largest donation is $ XXXXXXXXXXfrom Maria Nguyen
**************** Donor Menu *****************
1 - Display Donors XXXXXXXXXXAdd a Dono
2 - Display Donor Amounts XXXXXXXXXXAdd a Donation
3 - Display Largest Amount XXXXXXXXXXRemove a Dono
Q - Quit
Enter choice: 4
Add a Dono
Enter the first name: Sam
Enter the last name: Jones
Enter the email address: XXXXXXXXXX
Enter the city: Conway
Enter the state: NH
**************** Donor Menu *****************
1 - Display Donors XXXXXXXXXXAdd a Dono
2 - Display Donor Amounts XXXXXXXXXXAdd a Donation
3 - Display Largest Amount XXXXXXXXXXRemove
Answered 2 days After Nov 27, 2022

Solution

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