Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a Python class named BankAccount, to model the process of using the bank services through the ATM machine. Your class supports the following methods
Create a Python class named BankAccount, to model the process of using the bank services through the
ATM machine. Your class supports the following methods Please use the same methods definitions
You will define the attributes and how the methods will work. Then create instances of the
BankAccount with your names to test your code.
Class BankAccount:
Bank Account protected by a pin number."""
def self pin:
#Initial account balance is and pin is 'pin'.
def DepositToSelfself pin, amount:
#Increment balance by amount and return new balance.
def Withdrawself pin, amount:
#Decrement balance by amount and return amount withdrawn.
def Get Balanceself pin:
#Return account balance.
def ChangePinself oldpin, newpin:
#Change pin from old pin to new pin.
def DepositToDiffself pin, amount, yourEID, PersonAccountNo:
#Increment balance for another person in the same bank by amount and return
new balance.
def CheckDepositself pin, check, amount:
#Increment balance by amount of the check and return new balance.
def Billpaymentself pin, BillType, BillAccountNo:
#Payment for bill ie Etisalat, ADDC, Du and DARB using the
BillAccountNo as a reference.
def CreditCardpayself pin, CrediCardLastDigits:
#Payment for the credit card balance Using the last digits of your
credit card no
Write a Python program that creates a class which represents an Employee in an organization. The class
includes a function that reads a text file called employee details.txt A sample of the file is provided
below Each row in the file corresponds to employee id employee name, number of years employed
and salary.
Also include the following functions to process the content read from the file.
a getData: This method reads the data from a file and stores the data as a list.
b totalSalary: This method calculates the total salary for each employee. The method should add an
incentive of to the total salary if the number of years worked by the employee is greater than
years.
c whoishighestTotalSalary and whoislowestTotalSalary: These methods calculate the highest and
lowest total salary and display the respective employee names.
d sortEmployeeBySalary: Sort the employee list in the ascending order of their salaries.
e AverageSalary: calculate the average of their salaries.
Sample input file: employee details.txt
E Hasan A Jasim,
E Smith John Krane,
E Malik Nathan,
E Sifora. M Sam,
E Tony Knot Blair,
E Ahmed Salem,
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started