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
How has the timing of the transition to a free-market economy been used to partially explain the great difference in inequality
Lilit [14]

Inequality of wealth is a pressing issue right now, both in the US and abroad.

Political scientists should participate in the discussion about wealth inequality, which is a hot topic right now. There is scant proof that democracy and wealth disparity are always related. Although democracy offers numerous benefits, nations do not always move toward greater economic equality as a result.

This isn't because public policy doesn't matter; rather, it's because democracies don't always enact measures that equalize wealth. It is less likely that societies where there are cleavages other than money will embrace wealth-equalizing policies. The impact of democratic politics on wealth is also substantially influenced by voters' perceptions of justice.

Because wealth is not only unequal but also due to this position arose for what voters believe to be unfair causes, voters are most inclined to back redistribution or programs that promote equal chances. Finally, it's also conceivable that wealthy individuals could seize control of democratic politics. Examining when, why, and why this problem of capturing is much more acute in practice is an essential area for future research.

Learn more about inequality here:

brainly.com/question/24143597

#SPJ4

5 0
2 years ago
As a new employee in the Lottery Commission, your first job is to design a new prize. Your idea is to create two grand prize cho
mrs_skeptik [129]

Answer:

a.  $265,336

Explanation:

we are told to calculate which amount will make both payments equal:

  • payment 1 = $1,000,000 in 5 years
  • payment 2 = $500,000 now + ? in 5 years

in order to be able to compare them, we must determine the value of the $500,000 paid now in 5 years:

future value = present value x (1 + interest rate)ⁿ

future value = $500,000 x (1 + 0.08)⁵ = $734,664

$1,000,000 = $734,664 + ?

? = $1,000,000 - $734,664 = $265,336

8 0
3 years ago
Bobby Jones, an accountant for ABC Corporation, has been suspected of committing fraud. Some information already gathered about
dexar [7]

Answer:

In the civil litigation process what will happen to Bobby Jones are in four stages which are Inquiry and Pleading, Discovery, Motion Practice and Negotiation and Trial and Appeal.

Explanation:

Four steps are involved in the process of civil litigation stated as follows:

In this staged a complaint is first issued against Bobby Jones by the ABC Corporation which elaborates on the offence and also points out the financial compensation for the damaged or problems caused.

Inquiry and Pleading: The first step or phase is the inquiry and pleading.  

In this staged a complaint is first issued against Bobby Jones by the ABC Corporation which elaborates on the offence and also points out the financial compensation for the damaged or problems caused.

(2) Discovery: This is where the various parties gives an effort to get more information as possible

(3) Motion Practice and Negotiation: This occurs prior to trial when bobby files motion to challenge the complaint issued against him.

(4)Trial and Appeal: The last stage is the trial and appeal. this occurs when the previous steps has failed.

In this step the trial is held, both Bobby and ABC Corporations seeks judgement from the judge and the judge issues the jury to put in the final verdict. If both parties are not satisfied with judgement received, they can appeal to a higher court to review the verdict or decision.

7 0
3 years ago
Elaine values the utility of her first cup of coffee at $1; a second cup, $.75; and a third cup, $.50. if elaine drinks three cu
Mashcka [7]

Elaine'S marginal utility is equal to  $2.25

Marginal utility is the added delight that a client receives from having one more unit of a great or provider. The concept of marginal application is utilized by economists to decide how much of an item consumers are inclined to buy.

Marginal utility is the greater benefit derived from consuming one extra unit of a specific properly or provider. the principle sorts of marginal utility encompass effective marginal utility, zero marginal application, and terrible marginal application. purchasers regularly enjoy higher marginal software while marginal fee is decrease.

expalnation

Assuming  that the utility that she is achieving after consuming a good is equal to the value of the coffee.

  = $1 +0.75 + 0.50

  = $ 2.25

Hence, the marginal utility is $ 2.25.

Learn more about marginal utility here:- brainly.com/question/15050855

#SPJ4

3 0
2 years ago
Based on the marginal principle, would it make sense to for a business to expand their hours of operation if they project $1,500
krek1111 [17]

Answer:

Yes, because they will net $300 per week

Explanation:

According to the marginal principle, production can be increased if marginal revenue would exceed marginal cost. It means that the venture would be profitable

Marginal cost is the increase in cost as a result of increasing output by one unit.

total marginal cost = 1000 + 50 + 150 = 1200

Marginal revenue is the increase in revenue as a result of increasing output by one unit.

Marginal revenue exceeds marginal cost by (1500 - 1200) 300. Thus, hours of operation can be increased

6 0
3 years ago
Other questions:
  • Gamma Company adjusts its accounts at the end of each month. The following information has been assembled in order to prepare th
    5·1 answer
  • Find the following values using the equations and then a financial calculator. Compounding/discounting occurs annually. Do not r
    6·1 answer
  • Moyer Corporation is a specialty component manufacturer with idle capacity. Management would like to use its extra capacity to g
    14·1 answer
  • edmiston Company reported the following year-end information: beginning work-in-process inventory, $80,000; cost of goods manufa
    6·1 answer
  • College Logos buys​ logo-imprinted merchandise and then sells it to university bookstores. Sales are expected to be $ 2 comma 00
    13·1 answer
  • The marketing of products and services to companies, governments, or not-for-profit organizations for use in the creation of goo
    11·1 answer
  • 5. If a company had $15,000 in net income for the year, and its sales were $300,000 for the same year, what is its profit margin
    9·1 answer
  • Your supervisor constantly gets on you for things that you feel aren't your fault. Every other day , they approach you about wor
    14·1 answer
  • Why does the law of increasing opportunity cost occur?
    11·1 answer
  • Using the allowance method, Bad Debt Expense is recorded _____.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!