$30
is a continuation from lab 7, where you need to create a class named ‘Account’ with
the following attributes:
Key
value
data type
Name
<userInput>
(string)
Savings
100
(float)
checking
20
(float)
Card
10
(float)
Limit
50
(int)
Define class methods “displayBalance ()” and “cashServices ()”. The method displayBalance () should
display the account owner’s name, his Account Balance and Available Balance in format and
alignment (use center aligned):
Account owner’s name: <Account.name>
Acc-Type
Account Balance
Available Balance
Savings
$
100.00
$
110.00
Checking
$
20.00
$
20.00
Card
$
10.00
$
40.00
The method cashServices () should ask the user to input the account type and amount to be deposited in
the account type. Let ‘S’ denotes Savings, ‘K’ denotes Checking and ‘C’ denotes Card account type.
The user should input the account type and amount separated by space in a single line. The amount
entered by the user should be updated in the respective account and should get reflected in the
displayBalance ().
The program should start by calling a menu (), which should display the following menu.
1. Display Balance
2. Cash Services
3. Exit
All the rules in the displayBalance () are same as in the previous assignment.
Note: For cashServices (), use only Savings and Checking account for updating.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.CSCI 161
• The program should include a comment block at the top with your name, course number and
course section, assignment number