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
Which of the following statements regarding a 30-year monthly payment amortized mortgage with a nominal interest rate of 8% is C
sertanlavr [38]

Answer:

C. A smaller proportion of the last monthly payment will be interest, and a larger proportion will be principal, than for the first monthly payment.

Explanation:

I prepared a summary of an amortization schedule to explain this:

principal = $100,000

r = 8% annual

n = 360 months

first payment = $733.76: $666.67 are interests and only $67.09 reduces principal

second payment = $733.76: $665.95 are interests and only $67.54 reduces principal

last payment = $733.76: $4.90 are interests and only $728.86 reduces principal to $0

6 0
3 years ago
Which of the following are examples of natural barriers to entry? Correct Answer(s) Drag appropriate answer(s) here Smaller comp
andreyandreev [35.5K]

Answer:

These are correct:

  • Smaller companies with smaller production processes have higher per unit costs than larger companies. - smaller firms find it harder to adopt economies of scale to reduce costs.
  • Over time, a firm takes control of 85% of the world’s supply of a chemical used in the production of plastic. - the firm has almost total control over a scarce resource, and new competitors have to scramble for the remaning 15%. (note: this is a natural barrier to entry as long as the pharmaceutical company did not collude with the government to reach such a high market share, in said case, it would be an artificial barrier to entry).
  • Lenders are hesitant to provide funding for new firms that will compete with a large, well-established firm. - a small firm may lack market credibility in the financial markets, because investors are hesitant about the future of the company, or do not expect high rates of return.

5 0
3 years ago
Cyclical unemployment refers to A. the portion of unemployment created by job search. B. the portion of unemployment created by
myrzilka [38]

Answer:

i pretty sure its c but if it wrong just let me know

Explanation:

it pretty much makes sence

can i get brainlest

6 0
3 years ago
The June 30, 2021, year-end trial balance for Askew company contained the following information: Account Debit Credit Inventory,
user100 [1]

The cost of goods sold for the Askew Company for the year ending June 30, 2021 is $233,000.

Using this formula

Cost of goods sold=Beginning Inventory+ Net purchases- Ending Inventory

Where:

Beginning Inventory=$32,000

Net purchases=($240,000-$6,000-$10,000+$17,000)=$241,000

Ending Inventory=$40,000

Let plug in the formula

Cost of goods sold=$32,000+$241,000-$40,000

Cost of goods sold=$233,000

Inconclusion the cost of goods sold for the Askew Company for the year ending June 30, 2021 is $233,000.

Learn more here:

brainly.com/question/15708509

4 0
2 years ago
A company is evaluating an investment which has an initial investment of $15,000. Expected annual net cash flows over four years
vladimir2022 [97]

Answer:

$850

Explanation:

Data provided in the question:

Initial investment = $15,000

Expected annual net cash flows over four years, R = $5,000

Return on the investment = 10% = 0.10

Present value of an annuity factor for 10% and 4 periods, PVAF = 3.1699

The present value of $1 factor for 10% and 4 periods = 0.6830

Now,

Net present value = [ R × PVAF ] - Initial investment

= [ $5,000 × 3.1699 ] - $ 15,000

= $15,849.50 - $ 15000

= $849.50 ≈ $850

4 0
3 years ago
Other questions:
  • A useful guideline in designing policies and operating procedures that facilitate good strategy execution is ________.
    13·1 answer
  • The salary foregone by a person who quits a job to start a business is an example of a(n) ________. Select one: A. depreciable c
    15·2 answers
  • Steve, an engineer in a construction company, is at present working on a home construction project. the home is being built for
    7·1 answer
  • In the U.S. political arena, ______________________ may tend to emphasize the virtues of markets and the limitations of governme
    5·1 answer
  • Chris bought 10 shares of Apex Company for $25 each, and later sold all of them at $45 each. This transaction resulted in what t
    14·2 answers
  • In what form of business do members of an organization own and control its activities
    10·1 answer
  • Many organizations are concerned about the rising cost of employee benefits and question their value to the organization and to
    11·1 answer
  • The common stock of Federal Logistics is selling for $57.56 per share. The company pays a constant annual dividend and has a tot
    5·1 answer
  • Furniture purchase for cash in accounting equation​
    8·1 answer
  • Power that organizes and orchestrates the systemic interaction within and among societies is an example of?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!