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
Investments in debt securities that the company actively manages and trades for profit are referred to as short-term debt invest
boyakko [2]

Answer: c. trading securities.

Explanation:

Trading securities are short term debt securities that a company buys in order to make a profit in that short term period. They actively manage and trade these securities and then trade them for profit.

It is an excellent way to gain return for any excess cash that the business has and they only invest in such things when they believe that there is a good chance of profit being made.

7 0
3 years ago
Anna is a forensic scientist who still uses the methods used by Dr. Leone Lattes. How is this MOST likely demonstrated in Anna’s
Nikolay [14]
A is the answer took the test
4 0
3 years ago
Select all that apply
ANTONII [103]

Answer:

Go to your financial institution

Endorse the check and return it to whoever gave it to you

4 0
2 years ago
Which statement provides the correct information regarding the parts
Alborosie

Answer:

I don't know but good luck finding the answer

Explanation:

3 0
2 years ago
For a recent 2-year period, the balance sheet of Blue Company showed the following stockholders’ equity data at December 31 (in
Misha Larkins [42]

Answer:

Par value of common stock is $2.5

Explanation:

The par value of common stock can determined by dividing the common stock total amount in each of the two years by the shares issued and outstanding in each year as demonstrated below:

2019:

Par value of common stock =Common stock($)/shares issued

common stock($) is $555 million

shares issued and outstanding is 222 million shares

par value of common stock=$555 million/222 million=$2.5

2020:

Par value of common stock =Common stock($)/shares issued

common stock($) is $560 million

shares issued and outstanding is 224 million shares

par value of common stock=$560 million/224 million=$2.5

Ultimately the par value of common stock as shown be computations for both years is $2.5

7 0
2 years ago
Other questions:
  • Four investment bankers need to cross a bridge at night to get to a meeting. They have only one flashlight and 17 minutes to get
    15·1 answer
  • Candlewood LLC started business on September 1, and it adopted a calendar tax year. During the year, Candlewood incurred $6,500
    6·1 answer
  • On December 31, the Income Summary account of Madison Company has a debit balance of $111,000 after revenue of $117,000 and expe
    9·1 answer
  • What is the revised net operating income if the selling price per unit increases by 10%, variable expenses increase by 30 cents
    8·2 answers
  • Groupong Inc. recently paid a $2.78 annual dividend on its common stock. This dividend increases at 3.50 percent per year and th
    12·1 answer
  • LO 1.5What is corporate social responsibility, and who are the stakeholders?
    13·1 answer
  • Georges Bank, a highly productive fishing area off New England, can be divided into two zones in terms of fish population. Zone
    15·1 answer
  • The stock of North American Dandruff Company is currently selling at $80 per share. The firm pays a dividend of $2.50 per share.
    15·1 answer
  • Determine the amount to be paid in full settlement of each of the following invoices, assuming that credit for returns and allow
    6·1 answer
  • How you will differentiate the company from
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!