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
Which function in Excel tells how many
Vikki [24]

Answer:

COUNT

Explanation:

Hope this helps! Plz mark brainliest!

3 0
2 years ago
In which situations would it be most helpful to filter a form? Check all that apply.
Paladinen [302]

Answer: hey did you find the answer? Do you mind telling me it?

Explanation:

8 0
3 years ago
A man-in-the-middle attack or impersonation are likely to result in problems with
Ivan

Answer:

Data Confidentiality

Explanation:

A Man-In-The-Middle-Attack (MITM) is an attack when a hacker gets between a communicative situation and digitally eavesdrops.

6 0
3 years ago
all of the following are new technology-related trends in mis except: group of answer choices the mobile digital platform. iot.
Bess [88]

The option that is note a new technology-related trends in MIS is co-creation of business value.

<h3>Technology and Management Information System:</h3>

Technology and Management Information System is known to be a term that connote the way a person can know or understand data that is obtained from a lot of units and departments of an organization.

Note that It can be used in the area of integration with other types of technology and as such, The option that is note a new technology-related trends in MIS is co-creation of business value.

Learn more about  business value from

brainly.com/question/25528419

#SPJ1

5 0
2 years ago
Each time the enter key is pressed, word creates a new paragraph. (points : 2) true false
ludmilkaskok [199]
Your answer would be true
6 0
2 years ago
Other questions:
  • Samantha plans an investigation in which she will study a population of animals. Which of these answers best describes the focus
    8·1 answer
  • Write the definitions of two classes Day and Night. Both classes have no constructors, methods or instance variables. Note: For
    8·1 answer
  • A technician is talking to end users about the specifications for an upgraded application server. The users of the application r
    11·1 answer
  • One of the advantages of off-the-shelf software is that ________________. a. the software contains important features, thus elim
    13·1 answer
  • This is not based on homework but I have a question. I am currently using a gtx 960 with a 6 core amd processor. Does anyone kno
    6·1 answer
  • You are part of the team to implement new software at XYZ Inc. The employees at XYZ Inc. trust the results of the old software p
    15·1 answer
  • Which of the following statements is FALSE?
    5·1 answer
  • Did it surprise you to discover that the Sun is actually a star in the middle of its life cycle? Why or why not?
    8·1 answer
  • You are critiquing a logo design that one of your coworkers proposed. Your sense is that the individual elements of the design a
    10·1 answer
  • What can a user modify on a business card using the Edit Business Card dialog box? Check all that apply.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!