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]
2 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]2 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
Ok write your age and then multiple it by ten then divide it by your birth year
mixas84 [53]

Answer:

150 divided by 5 = 30

Explanation:

4 0
3 years ago
Read 2 more answers
A corporation following a _________ emphasizing vertical or horizontal growth would probably want an aggressive new chief execut
UkoKoshka [18]

Answer:

concentration strategy

Explanation:

This is an approach in which a business focuses on a single market or product which allows the company to invest more resources in production and marketing in that one area.

3 0
3 years ago
Read 2 more answers
A company has set a low price on a new product it introduced. It wants to maximize its market share and attract a large number o
KATRIN_1 [288]

Answer:

A. Market-penetration pricing

6 0
2 years ago
Read 2 more answers
If the government wants to increase production of a good to achieve marginal social benefit, then the following policy will most
Kobotan [32]

Answer:

a. a subsidy so that the firm can operate where marginal social benefit equals marginal social cost.

Explanation:

The private company is producing when the marginal revenue matches the marginal cost. The governemtn will want to decrease the cost (that's by subsidize the activity) to match the marginal revenue considering the positive externalities.

The government will do a pigouvian subsidy.

The government reasons to go for this is that the good or services provide positive externalities Which are enjoy by people who doens't purchase the good. Thus, this subsidy will increase the amount of ooutput thus, generating a better social benefit.

6 0
3 years ago
What is small business development
makvit [3.9K]

Answer:

Explanation:

Small Business Development Centers (SBDCs) provide business-related assistance and knowledge to help entrepreneurs start, run, and grow their businesses.

5 0
1 year ago
Other questions:
  • Burgundy Manufacturing uses a process cost system and computes cost using the weighted average method. During the current period
    14·1 answer
  • Aunt​ Emily's Food Products is famous for its frosted fruit cake. The main ingredient of the cake is dried​ fruit, which Aunt​ E
    9·1 answer
  • Lightfoot Inc., a software development firm, has stock outstanding as follows: 25,000 shares of cumulative preferred 3% stock, $
    9·1 answer
  • As old central business districts and industrial zones in more developed countries lost businesses and employment in the mid- to
    7·1 answer
  • Northwoods Backpackers is a retail catalog store in Vermont that specializes in outdoor clothing and camping equipment. Phone or
    5·1 answer
  • Ana is trying to finish an account analysis for a client, but she's missing data. She e-mails Claire in database administration
    10·1 answer
  • Fitbit makes health and fitness tracking devices. some buyers want very basic fitness tracking such as steps taken and calories
    5·1 answer
  • Cricket Corp. issued, without consideration, rights allowing stockholders to subscribe for additional shares at an amount greate
    14·1 answer
  • During its first year of operations, JKL Company paid $11,065 for direct materials and $11,200 for production workers' wages. Le
    15·1 answer
  • Please help!! This is for economics
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!