Starting from:

$30

CSCI161L Assignment 7 -Solved


Define a class named ‘Account’ with 5 attributes and initialize them as below 
Key 
value 
data type 
Name 
<userInput> 
(string) 
Savings 
100 
(float) 
checking 
20 
(float) 
Card 
10 
(float) 
Limit 
50 
(int) 
1) Create a menu(), which will display the options as shown below: 
Option 1: Check Balance 
Option 2: Exit 
Option 1(Check Balance), should call a function check_balance(). 
2) The function, check_balance() should display the account owner’s name, his 
Account Balance and Available Balance in exact format and alignment as below. 
Account owner’s name: <Account.name> 
Account Balance 
Available Balance 
Savings 

100.00 

110.00 
Checking 

20.00 

20.00 
Card 

10.00 

40.00 
Note: The alignment must be the same 
3) Data in the Account balance column is hardcoded; data in the available balance 
column should be computed dynamically. Rules to compute available balance of 
account: 
a) $10 minimum amount must be maintained in the savings account. Therefore, 
the available balance is the account balance plus minimum amount. 
b) Checking account can have any amount larger than or equal to 0. 
c) Card available balance cannot exceed its limit (50$), so the available balance 
is thedifference between the limit and current card balance. 
d) If requirements aren’t met, ‘Available account’ should be illustrated as 0, for 
all options 
Tip 
You can use string formatting in conjunction with tab for output alignment but using only 
tab will not be a good choice.CSCI 161 
Sample output: 
Instructions: 
• Preferred programming environment: 
o OS 
: Linux (Mint) 
o Interpreter : Python 3 (not Python 2) 
o Editor 
: gedit or editor of your choice 
• The program is saved as a file with .py extension. 
• The program should include a comment block at the top with your name, course number and 
course section, assignment number 
For example: 

More products