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
Identify the financial statement where these decision makers can find the following information about​ Flurry, Inc. In some​ cas
Ludmilka [50]

Answer:

a. Ending cash balance

You can find the ending cash balance in both the balance sheet and the statement of cash flows.

b. Adjustments to reconcile net income to net cash provided by operations

You can find this information in the statement of cash flows (under cash flows from operating activities).

c. Common stock

You can find this information in the balance sheet and the statement of stockholders' equity.

d. Total assets

You can find this information in the balance sheet

e. Net income

You can find this information in the income statement and the statement of cash flows (under cash flows from operating activities).

f. Revenue

You can find this information in the income statement.

g. Income tax payable

You can find this information in the balance sheet. Total income tax liability can be found int he income statement but it doesn't show us the unpaid amount. Also, the statement of cash flows shows us how this account changes from one year to the next.

4 0
3 years ago
Abby sells real property for $300,000. The buyer pays $5,000 in property taxes that had accrued during the year while the proper
tamaranim1 [39]

Answer:

a. $287,000

Explanation:

According to the given situation, the computation of the amount realized is shown below:-

Amount realized = Sale value consideration + Property taxes paid by the buyer - Commission - Legal fees

= $300,000 + $5,000 - $15,000 - $3,000

= $305,000 - $18,000

= $287,000

Therefore for computing the amount realized we simply above formula.

5 0
3 years ago
Eric enjoys making pizza. when he makes pizza for his friends, sometimes eric cares about how the pieces are distributed, and so
Tamiku [17]

To answer the question we can look at the definitions of both "efficiency". and equity", and decide which action falls under what category:<span>
Efficiency is the quality to successfully finish a job without wasting any time or resources, by this definition when Eric does not care about how the pieces are distributed, he is showing efficiency, not wasting time or energy to distribute, but finishing the distribution.
Equity means the ability to be partial or fair with all, when Eric cares about how the pieces are distributed, he is showing equity.</span>

3 0
3 years ago
The presence of barriers to entry in a particular market will generally make acquisitions __________ as an entry strategy
Vesnalui [34]

The presence of barriers to entry in a particular market will generally make acquisitions MORE likely as an entry strategy.

A primary cause for a company to pursue an acquisition is to: b. reap greater market energy.Top Industries simply went through a restructuring and is experiencing reduced hard work costs.

Diversification of the goods, services and long-term possibilities of your enterprise. A goal commercial enterprise may be capable of provide you services or products which you may promote via your personal distribution channels. lowering your expenses and overheads thru shared marketing budgets, accelerated buying strength and decrease costs

Disclaimer:-Your question is incomplete,for ncomplete quwestion question see below.

The presence of barriers to entry in a particular market will generally make acquisitions __________ as an entry strategy.

a. more likely

b. less likely

c. prohibitive

d. illegal

Learn more about acquistions strategy here:-brainly.com/question/23971468

#SPJ4

8 0
2 years ago
Stor Manufacturing stores hazardous and volatile chemicals in its warehouse. The warehouse has state-of-the-art equipment to mak
Dima020 [189]

Answer:

liable for Williams injuries

Explanation:

Hello! Astor, being a possessor of dangerous products for the organism, has to take precautions so that in unexpected cases such as a meteorological incident his merchandise does not harm anyone. In this case, he is totally responsible for William's injuries for not preventing before.

Thanks for your question!

7 0
3 years ago
Read 2 more answers
Other questions:
  • Based on your readings regarding the volume of big data, choose the list that represents the items in the list in terms of gener
    7·1 answer
  • What do you feel would be a minimally acceptable rate of pay? (ex. $X.XX or $XX,XXX):_______.
    5·1 answer
  • Kingbird Company is negotiating to lease a piece of equipment to MTBA, Inc. MTBA requests that the lease be for 9 years. The equ
    8·1 answer
  • An online advertisement linked to Nutri, a dietary supplement shop, was served to 73% of the customers on a sports enthusiast we
    8·1 answer
  • With practical illustrations, discuss how managers can leverage on organizational behaviour components to maximize business succ
    5·1 answer
  • Record the adjusting entry for salaries payable (LO3-3) Fighting Irish Incorporated pays its employees $3,220 every two weeks ($
    8·1 answer
  • In Cognitive theory,
    13·1 answer
  • Consider a Caribbean cruise route served by two cruise​ lines, Carnival and Royal Caribbean. Both lines must choose whether to c
    9·1 answer
  • All of the following statements related to recording warranty expense are true except: Multiple Choice Recording estimated warra
    8·1 answer
  • This credit account carries a temporary low introductory rate (teaser rate) of_________%. This teaser APR applies to purchases m
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!