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
g Estimate the cost of common equity for a firm, given the following information. For the next year, the firm plans to pay a div
wel

Answer:

The cost of equity is 12.49 percent

Explanation:

The price per share of a company whose dividends are expected to grow at a constant rate can be calculated using the constant growth model of the DMM. The DDM bases the price of a stock on the present value of the expected future dividends from the stock. The formula for price today under this model is,

P0 = D1 / r - g

Where,

  • D1 is the dividend expected for the next period
  • r is the cost of equity
  • g is the growth rate in dividends

As we already know the P0 which is price today, the D1 and the growth rate in dividends (g), we can plug in the values of these variables in the formula to calculate the cost of equity (r)

100.81 = 8.76 / (r - 0.038)

100.81 * (r - 0.038) = 8.76

100.81r  -  3.83078 = 8.76

100.81r  =  8.76 + 3.83078

r = 12.59078 / 100.81

r = 0.12489 or 12.489% rounded off to 12.49%

6 0
3 years ago
Which of the following is an example of a social career?
hichkok12 [17]
Nurse is an example of that
4 0
3 years ago
Slick Sam has a special relationship with his banker. The nature of the relationship is as follows: The bank owes Sam $100 per y
joja [24]

Answer:

X=97.24

Explanation:

PV = Present Value = X+2000 by the 16th years

PMT = Payments = $100

FV = Future Value = 2000 at the end of 16 years

n= number of years

Applying the equation of future value for annuity

FV = pmt* ​((1+r)ⁿ - 1   )/r

Inputting the values;

2000=100*((1+r)¹⁶-1)/r

Solving for r, gives r = 2.9%

Therefore using the formula for PV for annuity;

PV=PMT*(1-(1/1+r)/r)

X=100*(1-(1/1.029)/0.029

X=100*((1-0.9718)/0.029)

X=100*(0.0282/0.029)

X=97.24

7 0
3 years ago
What is the single most important factor in determining the success or failure
horsena [70]

<u>Answer:</u>

Answer Choice: <em>A. Communication</em>

<u></u>

<u>Explanation:</u>

Communication is the single most important factor in determining the success or failure of a project because the better you explain the project the higher your grade will be so, that will result in your grade being a A or a B so, that will cause you to pass, and the worst you explain the project the lower your grade will be so, that will result in your grade being a C or D or F (or an E depending on how your school grades) so, that will cause you to fail.

6 0
2 years ago
Hot Wings, Inc., has an odd dividend policy. The company has just paid a dividend of $8.50 per share and has announced that it w
Vadim26 [7]

Answer:

The correct answer is $65.90 (approx.)

Explanation:

According to the scenario, computation of the given data are as follows:

Dividend paid = $8.50

Increase dividend = $6.50 per year

Require return = 16%

We can calculate the current share price by using following method:

=[($8.5 + $6.5) ÷ (1 + 16%)^1] + [($8.5 + $6.5 + $6.5) ÷ ( 1 + 16%)^2] +[($8.5 + $6.5 + $6.5 + $6.5) ÷ (1+16%)^3] + [($8.5 + $6.5+ $6.5 + $6.5 + $6.5) ÷ (1+16%)^4

= $15 ÷ 1.16 + $21.5 ÷ 1.16^2 + 28 ÷ 1.16^3 + 34.5 ÷ 1.16^4

= $65.90 (approx.)

3 0
3 years ago
Other questions:
  • Anchor Company purchased a manufacturing machine with a list price of $85,000 and received a 2% cash discount on the purchase. T
    13·1 answer
  • A 10-year bond of a firm in severe financial distress has a coupon rate of 14% and sells for $900. The firm is currently renegot
    15·1 answer
  • For a particular flight from Dulles to SF, USAir uses wide-body jets with a capacity of 430 passengers. It costs the airline $4,
    10·1 answer
  • Inventory by Three Methods The units of an item available for sale during the year were as follows: Jan.1 Inventory 26 units at
    5·1 answer
  • What is the primary benefit for people and nations that engage in trade?
    5·1 answer
  • Doogan Corporation makes a product with the following standard costs: Standard Quantity or Hours Standard Price or Rate Direct m
    11·1 answer
  • Exercise 23-8 Sell or process further LO A1 Cobe Company has already manufactured 15,000 units of Product A at a cost of $30 per
    15·1 answer
  • 11. If you saw an employee take damaged merchandise that had been thrown away, what would
    15·1 answer
  • A nightclub has several types of employees, each with a specialized task. Bartenders make drinks, bouncers check identification,
    10·1 answer
  • Sales $ 22,235,000 Variable expenses 13,981,800 Contribution margin 8,253,200 Fixed expenses 6,100,000 Net operating income $ 2,
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!