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
What is the final gear reduction of a compound gear reduction of 36 to 12 for the first stage and 60 to 12 for the second stage?
OverLord2011 [107]

Answer:

8

Explanation:

Gear reduction = driven gear teeth / driving gear teeth

First stage reduction :

Driven gear teeth = 36

Driving gear teeth = 12

36 /12 = 3

Second stage reduction :

Driven gear teeth = 60

Driving gear teeth = 12

60 /12 = 5

First stage + second stage

3 + 5 = 8

5 0
3 years ago
To improve readability,______ use text on a dark green background.
Olenka [21]

To improve readability, use white text on a dark green background but <span>the darker text on a lighter background was rated more readable than lighter text on dark backgrounds according to survey in every color combination. Example, red text on white background is more readable than white text on red background.</span>


7 0
2 years ago
Read 2 more answers
You have a notebook computer and wish to connect to an IEEE 802.11n wireless network. The computer does not have a built-in wire
Ira Lisetskai [31]

Answer:

The wireless adapter to use is the Wireless USB 2.0 Extender

Explanation:

The Wireless USB 2.0 Extender is a USB component that enables a computer to connect to and communicate with other computers on a network, or even to connect to the internet.

It uses an IEEE 802.11g radio platform and communicates within a radio frequency range of 2.4GHz.

Therefore, in cases where a notebook computer does not have a built-in wireless LAN card or PC card interface, you can use the Wireless USB 2.0 Extender as the best solution to that problem.

3 0
2 years ago
An online company wants to conduct real-time sentiment analysis about its products from its social media channels using SQL.
iogann1982 [59]

Answer:

An online company wants to conduct real-time sentiment analysis about its products from its social media channels using SQL. The solution which has lowest cost and operational burden is as follow:

B. Configure the input stream using Amazon Kinesis Data Streams. Use Amazon Kinesis Data Analytics to write SQL queries against the stream.

Explanation:

  • The option A is not correct as this solution doesn't have lowest cost and operational burden as set up a streaming data ingestion application on Amazon EC2 and connect it to a Hadoop cluster for data processing will have more cost and operational burden.
  • The lowest cost and operational burden solution is that we configure input stream using Amazon Kinesis Data Streams. We can use Amazon Kinesis Data Analytics to write SQL queries against the stream.
  • The option c and d are also more pricey in terms of cost and operational burden as compared to Amazon Kinesis Data stream and analytics.  

4 0
3 years ago
Absolute time would be most similar to :
Luda [366]
The absolute time would be most similar to a fact. It was theorised and in fact, approved by scientists as a scientific law which governs, according to Wikipedia, as a "<span>true and mathematical </span>time<span>, of itself, and from its own nature flows equably without regard to anything external, and by another name is called duration: relative, apparent and common </span><span>time."</span>
3 0
3 years ago
Other questions:
  • How did the invention of the printing press lead eventually to an increase in the diversity of religious expression?
    7·1 answer
  • Clunker Motors Inc. is recalling all vehicles in its Extravagant line from model years 1999-2002 as well all vehicles in its Guz
    15·1 answer
  • Differentiate between trusted-source-security and antispoofing-security techniques.
    10·1 answer
  • In the RSA system, the receiver does as follows:1. Randomly select two large prime numbers p and q, which always must bekept sec
    6·1 answer
  • Speed(?)
    5·1 answer
  • Which best explains a password attached to a document?
    6·2 answers
  • The ______ engine compares your entry against its database and returns a list of hits or sites that contain the keywords. (hint:
    8·1 answer
  • Please Answer ASAP!!
    15·1 answer
  • Why do Linux administrators prefer to give sudo access to application teams instead of letting them su to root?
    6·1 answer
  • When you use the predict step in the IPDE process you
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!