Question: Objective: To work with functions in Python Assignment: Create a function named main. In the main () ask the user to enter his/her name and
Objective: To work with functions in Python
Assignment: Create a function named main. In the main () ask the user to enter his/her name and initialize a dictionary variable account with 5 key-value pairs as below. Numbers must be in the same data type as specified in the parenthesis.
Key Value Data type
Name user input (string)
Savings 100 (float)
Checking 20 (float)
Card 10 (float)
Limit 50 (int)
Call a function named menu(), which will display the menu as shown below.
1. Display Balance
2. Update Account
3. Exit
For option 1, call the function displayBalance(), which will display the account balance and available balance of the account as shown below. The function displayBalance() should be called from the menu(), when user inputs option 1.
Account owners name:
Account Balance Available Balance
Savings $ 100.00 $ 90.00
Checking $ 20.00 $ 20.00
Card $ 10.00 $ 40.00
Rules to compute Available Balance:
a. $ 10 minimum amount must be maintained in the savings account. Therefore, the Available Balance in the Savings account is the difference between Account Balance and the minimum amount.
b. Checking account can have any amount larger than or equal to zero.
c. Card available balance cannot exceed its limit, so the available balance in the card account is the difference between the limit and the current card balance.
For option 2, call the function updateAccount(), which will update the Savings Account by debiting an amount of $200. Verify the current Account balance and Available balance of the account by checking option 1 again.
Only option to exit from the program is through Option 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
