Answered step by step
Verified Expert Solution
Link Copied!

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 2 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 0 and pin is 'pin'.
def DepositToSelf(self, pin, amount):
#Increment balance by amount and return new balance.
def Withdraw(self, pin, amount):
#Decrement balance by amount and return amount withdrawn.
def Get Balance(self, pin):
#Return account balance.
def Change_Pin(self, oldpin, newpin):
#Change pin from old pin to new pin.
def DepositToDiff(self, pin, amount, yourEID, PersonAccountNo):
#Increment balance for another person in the same bank by amount and return
new balance.
def CheckDeposit(self, pin, check, amount):
#Increment balance by amount of the check and return new balance.
def Billpayment(self, pin, BillType, BillAccountNo):
#Payment for bill (ie. Etisalat, ADDC, Du, and DARB) using the
BillAccountNo as a reference.
def CreditCard_pay(self, pin, CrediCardLastDigits):
#Payment for the credit card balance (Using the last 6 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 3% to the total salary if the number of years worked by the employee is greater than 4
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
E001, Hasan A Jasim, 9,8587
E002, Smith John Krane, 8,6770
E003, Malik Nathan, 7,8052
E004, Sifora. M. Sam, 2,9598
E005, Tony Knot Blair, 4,9170
E006, Ahmed Salem, 8,8188
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Ai And The Lottery Defying Odds With Intelligent Prediction

Authors: Gary Covella Ph D

1st Edition

B0CND1ZB98, 979-8223302568

More Books

Students also viewed these Databases questions

Question

Describe the nature of negative messages.

Answered: 1 week ago