Project 5- Bank The goal of this activity is to create an application that manages new bank accounts. Part 1 - Create a header comment with the title of this program, your name, and the date. Part 2 (Creating the lists) In this project we are creating new accounts in a bank's system. Continuously ask the user to enter the name of the new account followed by the balance of that account. This process should repeat until done is entered as the name of an account. Store the names of the accounts and balances of the accounts in two separate lists, where matching account names and balances have the same index in their corresponding list. If a name of an account is entered that already exists, add the balance that is entered to the balance of that existing account. If a negative balance is entered, ignore that entry and print "Invalid balance!". Example: If we were to look at the two lists that we've created based on this example, we would have one list of names that should look something like ['Thomas', 'Jack', Parama'] and a list of balances that should look something like [100, 25, 200]. Notice there is only a single entry for Jack and he has a balance of 25. Name of account: Thomas Balance of account: 100 Name of account: Jack Balance of account: 5 Name of account: Jack Balance of account: 20 Name of account: Parama Balance of account: 200 Name of account: done Part 3 (Updating the lists) This bank has a minimum balance requirement, so accounts that have a balance of $25 or less should be removed. This bank also offers bonuses to new accounts with a high balance, so accounts that have a balance of $200 or more get an extra $50. If we were to look at the two lists that we created based on the example in part 2 after this step, we would have one list of names that should look something like ['Thomas', Parama'] and a list of balances that should look something like [100, 250]. Notice that Jack's account was removed and Parama received an extra $50. Part 4 (Sorting the lists) The bank now wants to display the new accounts in an organized manner. Sort the two lists based on the balance of the accounts in descending order (accounts with largest balance first). Once the lists have been sorted, print out the list of names followed by the list of balances. If the lists are empty (either no accounts were entered or all accounts removed), instead print out "No accounts!". Example: If we were to look at the two lists that we created based on the example in part 2 after this step, we would have one list of names that should look something like ['Parama', 'Thomas'] and a list of balances that should look something like [250, 100]. Notice how the order of the accounts has switched because Parama has a larger balance than Thomas. Test Cases Here we have provided some example test cases for this assignment. Use these to test the functionality of your program. The output of your program should match these outputs exactly. Case 1 (basic functionality): Case 3 (invalid balance): ['Parama', 'Thomas'] [250, 100] Case 2 (merging accounts): Case 5 (long list): Name of account: Joe Balance of account: 100 Name of account: Bob Balance of account: 5 Name of account: Zach Balance of account: 200 Name of account: done ['Zach', 'Joe'] [250, 100] Name of account: George Balance of account: 25 Name of account: George Balance of account: 25 Name of ccount: George Balance of account: 25 Name of account: Abby Balance of account: 50 Name of account: Sarah Balance of account: 80 Name of account: Sarah Balance of account: 20 Name of account: Abby Balance of account: 100 Name of account: done ['Abby', 'Sarah', 'George'] [150, 100, 75] Case 4 (nothing is entered): Name of account: Gavin Balance of account: -100 Invalid balance! Name of account: Henry Balance of account: 50 Name of account: done ['Henry'] [50] Name of account: done No accounts! Name of account: Joe Balance of account: 100 Name of account: Matt Balance of account: 150 Name of account: Alex Balance of account: 75 Name of account: Henry Balance of account: 125 Name of account: Bob Balance of account: 50 Name of account: Susan Balance of account: 175 Name of account: done ['Susan', 'Matt', 'Henry', 'Joe', 'Alex', 'Bob'] [175, 150, 125, 100, 75, 50] Case 6 (everything together): Name of account: Thomas Balance of account: 50 Name of account: Parama Balance of account: 200 Name of account: Parama Balance of account: 50 T Name of account: Thomas Balance of account: 100 Name of account: Jack Balance of account: 1000 Name of account: Jack Balance of account: -100 Invalid balance! Name of account: Tina Balance of account: 20 Name of account: done ['Jack', 'Parama', 'Thomas'] [1050, 300, 150]

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Can you solve this project using Python? Thanks.

# Working with Bank Accounts in Python

## Goal
The goal of this task is to create a program that manages user bank accounts.

### Part 1 - Creating Variables
- Start by creating four variables to store the program name, your own name, the date, and the time.

### Part 2 - Creating the Lists
To keep track of bank accounts, use a list in Python (commonly called a type of database management system). This list will store account names and balances. Each account is a dictionary with 'name' and 'balance' keys. When new customers open accounts, their names and starting balances are added to this list. The program should allow: creating accounts, adding balances, and displaying accounts sorted by the amount they contain.

**Example of the List:**

```python
Name of account: Thomas
Balance of account: 100
Name of account: Jack
Balance of account: 5
Name of account: Jack
Balance of account: 200
Name of account: Parama
Balance of account: done
```

### Part 3 - Updating the Lists
In this part, update the balance when a transaction occurs (note that negative amounts are not allowed). If the user tries to withdraw more money than they have, print a message indicating the withdrawal cannot proceed.

### Part 4 - Sorting the Lists
Implement functionality to sort the accounts by balance in descending order. Accounts with equivalent balances are sorted alphabetically by name.

**Example of Sorted List:**

```python
['Parama', 'Thomas']
[200, 100]
```

### Test Case Examples
Here are examples of expected input and output for the program.

**Case 1 - Basic Transaction:**
```python
Name of account: Joe
Balance of account: 100
Balance of account: 50
...
Name of account: done
```

**Case 2 - Negative Balance:**
```python
Name of account: Gavin
Balance of account: -100
Invalid balance
```

**Case 3 - Empty List:**
```python
Name of account: done
No accounts!
```

**Case 4 - Complex Transactions:**
```python
Name of account: Thomas
Balance of account: 50
...
['Jack', 'Parama', 'Thomas']
[3000, 2000, 100]
```

This educational task helps students develop skills in managing data with lists and dictionaries, applying sorting
Transcribed Image Text:# Working with Bank Accounts in Python ## Goal The goal of this task is to create a program that manages user bank accounts. ### Part 1 - Creating Variables - Start by creating four variables to store the program name, your own name, the date, and the time. ### Part 2 - Creating the Lists To keep track of bank accounts, use a list in Python (commonly called a type of database management system). This list will store account names and balances. Each account is a dictionary with 'name' and 'balance' keys. When new customers open accounts, their names and starting balances are added to this list. The program should allow: creating accounts, adding balances, and displaying accounts sorted by the amount they contain. **Example of the List:** ```python Name of account: Thomas Balance of account: 100 Name of account: Jack Balance of account: 5 Name of account: Jack Balance of account: 200 Name of account: Parama Balance of account: done ``` ### Part 3 - Updating the Lists In this part, update the balance when a transaction occurs (note that negative amounts are not allowed). If the user tries to withdraw more money than they have, print a message indicating the withdrawal cannot proceed. ### Part 4 - Sorting the Lists Implement functionality to sort the accounts by balance in descending order. Accounts with equivalent balances are sorted alphabetically by name. **Example of Sorted List:** ```python ['Parama', 'Thomas'] [200, 100] ``` ### Test Case Examples Here are examples of expected input and output for the program. **Case 1 - Basic Transaction:** ```python Name of account: Joe Balance of account: 100 Balance of account: 50 ... Name of account: done ``` **Case 2 - Negative Balance:** ```python Name of account: Gavin Balance of account: -100 Invalid balance ``` **Case 3 - Empty List:** ```python Name of account: done No accounts! ``` **Case 4 - Complex Transactions:** ```python Name of account: Thomas Balance of account: 50 ... ['Jack', 'Parama', 'Thomas'] [3000, 2000, 100] ``` This educational task helps students develop skills in managing data with lists and dictionaries, applying sorting
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 7 images

Blurred answer
Knowledge Booster
Graphical User Interface
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education