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
adell [148]
3 years ago
6

Charge a $5 penalty if an attempt is made to withdraw more money than available in the account.Here the account string is "S" or

"C". "S" is for savings account. "C" is for checking account. For the deposit or withdraw, it indicates which account is affected. For a transfer it indicates the account from which the money is taken; the money is automatically transferred to the other account.
Business
1 answer:
romanna [79]3 years ago
8 0

Answer:

C++ code is explained below

Explanation:

class Account {

 double balance;

 double add(double sum) {

   balance += sum;

   return sum;  

 }

 double withdraw(double sum) {

   if (sum > balance) {  

     balance -= 5;

     return -5; // this will come in handy in Prob. 6  

   } else {  

     balance -= sum;

     return balance; // Notice: always >= 0 (never < 0)

   }

 }

 double inquire() { return balance; }  

 Account() { balance = 0; }

 Account(double sum) { balance = sum; }

 double interest (double rate) {

   return rate * balance;  

 }

}

_______________________________

class Bank {

 Account checking;

 Account savings;  

 void deposit(double amount, String account) {

   if (account.equals("C")) checking.add(amount);  

   else // my default

     savings.add(amount);  

 }

 void withdraw(double amount, String account) {

   if (account.equals("C")) checking.withdraw(amount);  

   else // my default

     savings.withdraw(amount);  

 }

 void transfer (double amount, String account) {

   if (account.equals("C"))  

     if (checking.withdraw(amount) >= 0)  

       savings.add(amount);  

     else checking.add(5); // somewhat fault-tolerant

   else // default

     if (savings.withdraw(amount) >= 0)  

       checking.add(amount);  

     else savings.add(5);  // no penalty for transfers

 }

 void printBalances() {

   System.out.println(

     "Checking: " + checking.inquire() +

     "\nSavings: " + savings.inquire()

   );  

 }

}

You might be interested in
Phoenix, a popular coffee shop chain in North America, recently opened 400 stores to cater to its rapidly increasing number of p
Arisa [49]

Answer: market penetration

Explanation: In order to carter to its rapidly increasing number of patrons, Phoenix is engaging in market penetration by opening 400 stores to this effect. Market penetration is simply defined as a process of increasing or making more sales to current customers of an organisation without changing or modifying the products of the organisation.

4 0
3 years ago
onceptual Connection: For each situation, identify the possible root cause(s) of the activity cost (such as plant layout, proces
Minchanka [31]

Answer:

Explanation:

For each situation, identify the possible root cause or causes of activity cost, among these:

1. Plant Layout

2. Process design

3. Product design

(A) PROCESS DESIGN

The design of the process of production is the root cause of activity cost here. From the rates given, it's clear that the manual method of production costs more time and money than the mechanical production method.

A minor cause of activity cost here is the PRODUCT DESIGN; the cost of which varies with the use of labour and the use of machine.

(B) PRODUCT DESIGN

Change in design of the gear (removal of some component parts) reduces set up time and cost.

(C) PLANT LAYOUT

Redesign of manufacturing plant saves the time and cost of moves.

3 0
3 years ago
Program trading is defined as automated trading generated by computer algorithms designed to react rapidly to changes in market
matrenka [14]

Answer:

no

Explanation:

no

4 0
3 years ago
A private university offers graduate assistantships to qualified students each year. In exchange for the waiver oftuition, gradu
alina1380 [7]

Answer:

A. tuition revenues of $4,000 and expenditures of $4,000.

Explanation:

If the student is not employed as a graduate assistant required to assist faculty members with research and other activities, we will have one:

a. The student will have to pay $4,000 tuition. This is a revenue to the university.

b. The private university will employ a research assistant and pay him $4,000. This an expenditure to the university.

Therefore, this transactions have to be required as highlighted in a. and b. above to track the actual revenue and expenditure implication of the waiver despite cash does not exchange hands.

7 0
4 years ago
An investment offers $6,400 per year for 15 years, with the first payment occurring one year from now. If the required return is
yawa3891 [41]

Answer:

PV= $62,158.4

Explanation:

Giving the following information:

Annual payment= $6,400

Number of periods= 15 years

Interest rate= 6% = 0.06

<u>First, we need to calculate the future value using the following formula:</u>

FV= {A*[(1+i)^n-1]}/i

A= annual payment

FV= {6,400*[(1.06^15) - 1]} / 0.06

FV= $148,966.21

<u>Now, the present value:</u>

PV= FV/(1+i)^n

PV= 148,966.21 / (1.06^15)

PV= $62,158.4

4 0
3 years ago
Other questions:
  • In microeconomics, what term refers to the measurement of responsiveness of the quantity demanded or the quantity supplied to a
    5·1 answer
  • Department is related to the organization as employee is related to a performance is be subordinate see coworker D supervisor E
    12·1 answer
  • The GDP of a country hasnt improved in the past three years. The central bank decided to take a measure that will increase the a
    15·1 answer
  • Decentralized purchasing is the practice where individual, local purchasing departments throughout a single corporation make the
    14·1 answer
  • Define the terms:
    12·1 answer
  • The 2017 balance sheet of Dream, Inc., showed current assets of $3,175 and current liabilities of $1,645. The 2018 balance sheet
    11·1 answer
  • Suppose you purchase a $1,000 TIPS on January 1, 2021. The bond carries a fixed coupon of 1 percent. Over the first two years, s
    5·1 answer
  • A developer buys a large tract of land and plans to develop several single family homes. To proceed, ______________ is needed.
    6·1 answer
  • A cost that would be included in product costs under both absorption costing and variable costing is:____.
    13·1 answer
  • melissa wants to retire with $40,000 per month. she needs $4,000,000 in principal at the time she retires in order to generate t
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!