1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kobusy [5.1K]
3 years ago
9

Banking Account

Computers and Technology
1 answer:
satela [25.4K]3 years ago
4 0

Answer:

Here is the Python script solution.

Explanation:

#!/usr/bin/python

"""Types of bank accounts"""

# Assignment:

# Bank Account Manager - Create a class called Account which will be an abstract

# class for three other classes called CheckingAccount, SavingsAccount and

# BusinessAccount. Manage credits and debits from these accounts through an ATM

# style program.

from __future__ import print_function

def pct_to_dec(num):

"""Returns decimal version of percent"""

dec = float(num) / 100

return dec

class Account(object):

"""Creates an Account"""

def __init__(self, balance, int_rate, act_type, min_balance, **kwargs):

self.balance = balance

self.int_rate = int_rate

self.act_type = act_type

self.min_balance = min_balance

super(Account, self).__init__(**kwargs)

def __str__(self):

"""Returns formatted account type and balance"""

# Charge $25 fee if balance drops below minimum

if self.balance < self.min_balance:

self.balance -= 25

# Add interest

self.balance += round(self.balance * pct_to_dec(self.int_rate), 2)

return '{0}: ${1}'.format(self.act_type, self.balance)

class CheckingAccount(Account):

"""Creates a CheckingAccount Account"""

def __init__(self, **kwargs):

super(CheckingAccount, self).__init__(**kwargs)

class SavingsAccount(Account):

"""Creates a SavingsAccount Account"""

def __init__(self, **kwargs):

super(SavingsAccount, self).__init__(**kwargs)

class BusinessAccount(Account):

"""Creates a BusinessAccount Account"""

def __init__(self, **kwargs):

super(BusinessAccount, self).__init__(**kwargs)

# pylint: disable=C0103

ca1 = CheckingAccount(balance=500, int_rate=0.25, act_type='Checking Account',

min_balance=0)

sa1 = SavingsAccount(balance=50, int_rate=0.50, act_type='Savings Account',

min_balance=0)

ba1 = BusinessAccount(balance=4000, int_rate=0.75, act_type='Business Account',

min_balance=5000)

# Month #1 statement, initial deposits plus interest

print(ca1)

print(sa1)

print(ba1)

print('-------------')

# Month #2 statement plus interest

# Make deposit into checking

setattr(ca1, 'balance', (ca1.balance + 1000))

# Withdraw from checking

setattr(ca1, 'balance', (ca1.balance - 500))

# Make a deposit into savings

setattr(sa1, 'balance', (sa1.balance + 100))

print(ca1)

print(sa1)

print(ba1)

print('-------------')

# Month #3 statement plus interest

# Make deposit into checking

setattr(ca1, 'balance', (ca1.balance + 2500))

# Withdraw from checking

setattr(ca1, 'balance', (ca1.balance - 700))

# Make a deposit into savings

setattr(sa1, 'balance', (sa1.balance + 100))

# Make a deposit into business

setattr(ba1, 'balance', (ba1.balance + 1000))

print(ca1)

print(sa1)

print(ba1)

You might be interested in
_______ allow(s) you to apply colorful, eye catching designs to a presentation all at once.
astraxan [27]

What are some options of answers, or is there none?


4 0
3 years ago
Read 2 more answers
When there is uncertainty of the product quality, buyers should not anticipate that the temporary warehouse seller of unbranded
Westkost [7]

Answer:

Offer several prices and qualities.

Explanation:

When there is uncertainty of the product quality, buyers should not anticipate that the temporary warehouse seller of unbranded computer equipment will deliver high quality because they will actually offer several prices and qualities.

In the essence, buyers will need to consider the value they are getting for a price they pay. There will be huge variety so the more price an equipment has, the more likely it has the chance that it's one of the best quality and vice versa also holds true.

6 0
3 years ago
Instant messaging is commonly referred to as
melomori [17]
Chat, IM, in real-time
7 0
3 years ago
What age did people set in farming villages
Sveta_85 [38]
As young as 10 years old

have a good day :)

5 0
3 years ago
Read 2 more answers
2. Assume that the reference variable r refers to a serializable object. Write code that serializes the object to the file Objec
Dafna11 [192]

Answer:

Carmen Katrit rgrtun fjdidnf cucixizshdbdbdjsisjsdndbdhdhduehebbwwwhwususiussjhsdbd

3 0
2 years ago
Other questions:
  • A friend has a CD of one of your favorite artists and has offered to let you copy it.
    8·1 answer
  • Where is the spell checker found in excel?
    7·2 answers
  • Security measures are sometimes described as a combination of physical, technical, and administrative (PTA) safeguards. Which of
    12·1 answer
  • What is looping in QBASIC​
    9·1 answer
  • Often duties and taxes are imposed on cars that are imported fron other countries. What type of incentives are these duties and
    12·1 answer
  • Fact Pattern: A sales transaction record designed to contain the information presented below. Column Information 1-10 Customer a
    13·1 answer
  • Engineers and scientists redesign a prototype if it does not work correctly true or false and why
    10·2 answers
  • One advantage of a resource like the World Wide Web is that it connects people with problems to people who have__
    14·1 answer
  • 1) ( IBADE - 2020)A legislação que regula o uso da Internet no Brasil por meio da previsão de princípios, garantias, direitos e
    9·1 answer
  • Which of the following is not a benefit of introducing an e-commerce solution to an organisation?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!