Create an inheritance hierarchy

Assignment Help Basic Computer Science
Reference no: EM13219464

Create an inheritance hierarchy that a bank might use to represent customers' bank accounts. All customers at this bank can deposit (i.e. credit) money into their accounts and withdraw (i.e. debit) money from their accounts. More specific types of accounts also exist. Savings accounts, for instance, earn interest on the money they hold. Checking accounts, on the other hand, charge a fee per transaction (i.e., credit or debit). Create an inheritance hierarchy containing base class Account and derived classes SavingsAccount and CheckingAccount that inherit from class Account. Base class Account should be an abstract class and should include one data member of type double to represent the account balance and another data member of type String to hold the name of the person the account belongs to. The class should provide a constructor that receives a name and an initial balance and uses these information to initialize the data members. The default constructor of this class should initialize the name to an empty string and the balance to 0.0. Add all necessary setter and getter methods to this class. The setter method for balance should validate that balance being set is greater than or equal to 0.0. If not the method should display an error message. The class should also provide two member methods Credit and Debit. Member method Credit(double amount) should add amount to the current balance. Member method Debit(double amount) should withdraw money (reduce balance by amount) from the Account and ensure that the amount does not exceed the Account's balance. If it does, the balance should be left unchanged and the method should print the message "Debit amount exceeded account balance.". Finally add an abstract method named Print which will be implemented in the derived classes.

Reference no: EM13219464

Questions Cloud

Explain the normal probability distribution : The mean life of these batteries follows the normal probability distribution with a mean of 35 hours. hours and a standard deviation of 5.6 hours. As a part of its quality assurance program, Power +, Inc. tests samples of 9 batteries.
Describe the reactance theory : Describe the Reactance Theory and explain why people sometimes do precisely the opposite of what they are told to do.
What is the point estimate of the population mean : Warren County Telephone Company claims in its annual report that "the typical customer spends $55 per month on local and long-distance service." A sample of 12 subscribers revealed the following amounts spent last month. $66,$63,$68,$60,$61,$60,$6..
Explain the current marketing communication : Describe the current marketing communication, identity, and brand position of Plaza Home Health Services. Conduct a Strengths Weaknesses Opportunities Threats (SWOT) analysis associated with the current marketing communication, identity, and brand ..
Create an inheritance hierarchy : Finally add an abstract method named Print which will be implemented in the derived classes.
Should these types of restrictions be made into law : The European Community has proposed a set of laws that would strictly limit how database information is used and who has access to it.
Find who experiences a decrease in consumer surplus : Alex is willing to pay $10, and Bella is willing to pay $8, for 1 pound of ribeye steak. When the price of ribeye steak increases from $9 to $11, Answer Alex experiences a decrease in consumer surplus, but Bella does not.
Write a function prototype for a function : Write a complete function called calcTriArea that will calculate and return the area of a triangle. It takes two float/double values: the base and height as its arguments. The area of a triangle is one-half the base times the height.
Resolve this problem within wireless technology : You can resolve this issue by wiring but you do not want to do that. What can you do to resolve this problem within wireless technology?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Information assets to estimate for risk management

If organization has three information assets to estimate for risk management as shown in accompanying data, which vulnerability must be evaluated for additional controls first?

  Finding instruction format for indirect addressing

Determine the instruction format, considering that there is no bit for indirect addressing.

  Prepare a sample network diagram

Prepare a sample network diagram, and indicate your recommended options.

  Explain customer relationship management system

Describe what do you mean by a "customer relationship management system". Write and explain several categories of CRM systems.

  A subroutine in marie assembly that multiplies two value

1)Write a subroutine in MARIE assembly that multiplies two values where the arguments for this subroutine are two pointers(each pointing to a value). The routine, multiply(a,b), performs *a x *b where a's value is the address storing the value being ..

  List and describe three guidelines for sound policy

List and describe briefly the three guidelines for sound policy, as stated by Bergeron and Bérubé. Are policies different from standards? In what way? Are policies different from procedures? In what way?

  Genetic algorithms can help scientists

Discuss how expert systems, neural networks, and genetic algorithms can help scientists meet medical challenges. Provide an example of each system.

  Security and ethical concerns in web-based tool

How could you use a wiki to collaborate with fellow students to improve this course? What security and ethical concerns would you have to consider if you implemented this classroom wiki?

  Write responsibility of professionals have to society

Write responsibility do computing professionals have to society at large and to other members of profession? Do they have any responsibilities or are their working lives only measured.

  Use mcnaughton''s wrap around rule

Use McNaughton's wrap around rule to construct a preemptive

  Benefits of a web-based computing environment

Web-based computing so for this essay question, explain in scholarly detail benefits of a Web-based computing environment.

  Design a 8m x 32 bit memory board

design a 8M x 32 bit memory board. You may use only 256K x 8 bit RAM chips with full parallel addressing.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd