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
Potter Industries has a bond issue outstanding with an annual coupon of 6% and a 10-year maturity. The par value of the bond is
kirill115 [55]

The value of the bond is $865.80.

<h3>What is a bond?</h3>

A bond is a debt instrument used to raise capital. Bondholders receive periodic interest payment. At the maturity of the bond, the bondholders receive the amount invested.

<h3>What is the value of the bond?</h3>

The value of the bond can be determined by calculating the present value of the bond. The present value is the sum of the discounted cash flows.

Present value = (60 / 1.08) +  (60 / 1.08^2) +  (60 / 1.08^3) +  (60 / 1.08^4) +  (60 / 1.08^5) +  (60 / 1.08^6) +  (60 / 1.08^7) +  (60 / 1.08^8) +  (60 / 1.08^9) +  (60 / 1.08^10) +  (1000 / 1.08^10) = $865.80

To learn more about present value, please check: brainly.com/question/25748668

5 0
3 years ago
A firm incurs $400 to manufacture a television. In the market, customers are willing to pay a maximum of $600 for the television
kotykmax [81]

Answer:

D. Economic value created.    

Explanation:

The reason is that the economic value created is the difference between the price the customer is willing to pay and the cost that the product actually costs to the firm.

Following is the formula for calculation of economic value created:

Economic Value Created = Value customer willing to pay   -  Cost of product

Here the television costs $400 to the firm and the customer is willing to pay $600 for the television. So by putting the values we have:

Economic Value Created = $600 - $400 = $200

So the correct option is option D.

5 0
3 years ago
One defining characteristic of pure monopoly is that the:.
ipn [44]

Answer:

No close substitutes for the product exist and there is one seller.

Explanation:

3 0
2 years ago
Read 2 more answers
On a total product curve with labor on the horizontal axis, the inflection point represents the quantity of labor where
emmainna [20.7K]
The appropriate response is the marginal product of labor is at its most elevated. In financial aspects, the marginal product of labor (MPL) is the adjustment in yield that outcomes from utilizing an additional unit of work. The minimal result of an element of generation is by and large characterized as the adjustment in yield-related with an adjustment in that component, holding different contributions to creation steady.
3 0
3 years ago
After a business transaction has been analyzed and entered in a journal, the next step in the recording process is to transfer t
Jlenok [28]
After recording the transaction in journal you must record it on General Ledger.
3 0
3 years ago
Other questions:
  • Wanda is the Chief Executive Officer of Pink corporation, a publicly traded, calendar year C corporation. For the current year,
    13·1 answer
  • Gracey's Department Stores has $200,000 of 6% noncumulative, nonparticipating, preferred stock outstanding. Gracey's also has $6
    14·1 answer
  • Once a person has been trained to operate a lift truck, they are authorized to use any type of lifting device
    7·1 answer
  • As a proponent of the free market, Adam Smith viewed the main factors of production as labor, land, capital and entrepreneurship
    13·1 answer
  • A large increase in the income level in the U.S. along with no growth in Mexico’s income level is normally expected to cause (as
    11·1 answer
  • Which of these situations would give rise to the free-rider problem? Items (6 items)
    7·1 answer
  • Without trade, the farmer produced and consumed 2 pounds of pork and 4 pounds of tomatoes and the rancher produced and consumed
    11·1 answer
  • Which report is more effective in evaluating the performance of profit centers?
    13·1 answer
  • g According to the CAPM, what is the expected rate of return for a stock with a beta of 1.2. when the risk-free rate is 6% and t
    11·1 answer
  • Ryan Company deposits all cash receipts on the day they are received and makes all cash payments by check. Ryan's June bank stat
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!