Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Textbook help, its not in textbook solutions from the textbook C++ Programming 7th edition Malik,D.S Chapter 12 programming exercise 5 (Long question) figure 12-25 above

Textbook help, its not in textbook solutions from the textbook C++ Programming 7th edition Malik,D.S Chapter 12 programming exercise 5 (Long question)

image text in transcribed

figure 12-25 above

Create all the classes as shown in the figure

Make bankAccount class and checkingAccount class to be abstract class

The function to create monthly statements in bankAccount class should be pure virtual function

The function to write checks in checkingAccount class should be pure virtual function

Set the default interest rate for highInterestChecking, highInterestSaving and CD to be 5%, the default interest rate for savingsAccount to be 3%, and the default interest rate for noServiceChargeChecking to be 2%

Set the default minimum balance for highInterestChecking to be $5000, the default minimum balance of highInterestSaving to be $2500, and the default minimum balance for noServiceChargeChecking to be $1000

Set the monthly service charge for the serviceChargeChecking to be $10, set the monthly maximum number of checks allowed for serviceChargeChecking to be 5, and set the service charge when the number of checks exceed the maximum number of checks allowed to be $5

Create the project and test the project

Banks offer various types of accounts, such as savings, checking, certificateof deposits, and money market, to attract customers as well as meet their specific needs. Two of the most commonly used accounts are savings andchecking. Each of these accounts has various options. For example, you mayhave a savings account that requires no minimum balance but has a lower interest rate. Similarly, you may have a checking account that limits thenumber of checks you may write. Another type of account that is used tosave money for the long term is certificate of deposit (CD).In this programming exercise, you use abstract classes and pure virtualfunctions to design classes to manipulate various types of accounts. For simplicity, assume that the bank offers three types of accounts: savings,checking, and certificate of deposit, as described next. Savings accounts: Suppose that the bank offers two types of savingsaccounts: one that has no minimum balance and a lower interest rate andanother that requires a minimum balance and has a higher interest rate. Checking accounts: Suppose that the bank offers three types of checkingaccounts: one with a monthly service charge, limited check writing, nominimum balance, and no interest; another with no monthly service charge,a minimum balance requirement, unlimited check writing and lower interest;and a third with no monthly service charge, a higher minimum requirement, ahigher interest rate, and unlimited check writing. Certificate of deposit (CD): In an account of this type, money is left for some time, and these accounts draw higher interest rates than savings or checking accounts. Suppose that you purchase a CD for six months. Thenwe say that the CD will mature in six months. The penalty for earlywithdrawal is stiff. Note that the class es bankAccount and checkingAccount areabstract. That is, we cannot instantiate objects of these classes. The other classes in Figure 12-25 are not abstract. bank ccount : Every bank account has an account number, the name of the owner, and a balance. Therefore, instance variables such as name , accountNumber , and balance should be declared in the abstract class bankAccount . Some operations common to all types of accounts are retrieveaccount owners name, account number, and account balance; make deposits;withdraw money; and create monthly statements. So include functions toimplement these operations. Some of these functions will be pure virtual. checking ccount A checking account is a bank account. Therefore, itinherits all the properties of a bank account. Because one of the objectives of a checking account is to be able to write checks, include the pure virtualfunction writeCheck to write a check. serviceChargeChecking A service charge checking account is a checkingaccount. Therefore, it inherits all the properties of a checking account. For simplicity, assume that this type of account does not pay any interest, allows theaccount holder to write a limited number of checks each month, and does notrequire any minimum balance. Include appropriate named constants, instancevariables, and functions in this class. noServiceChargeChecking A checking account with no monthly servicecharge is a checking account. Therefore, it inherits all the properties of achecking account. Furthermore, this type of account pays interest, allows theaccount holder to write checks, and requires a minimum balance. highInterestChecking A checking account with high interest is a checkingaccount with no monthly service charge. Therefore, it inherits all the properties of a no service charge checking account. Furthermore, this type of account payshigher interest and requires a higher minimum balance than the no servicecharge checking account. savings ccount A savings account is a bank account. Therefore, it inheritsall the properties of a bank account. Furthermore, a savings account also paysinterest. highInterestSavings A high-interest savings account is a savings account.Therefore, it inherits all the properties of a savings account. It also requires aminimum balance. certificateOfDeposit A certificate of deposit account is a bank account.Therefore, it inherits all the properties of a bank account. In addition, it hasinstance variables to store the number of CD maturity months, interest rate, andthe current CD month. Write the definitions of the classes described in this programming exercise and aprogram to test your classes.

:E I search or enter page a C++ Programming 898 I Chapter 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists checkingaccount ertificateofDepo savings Account hich Interestsavings servicecharge hecking Chan Checking tch FIGURE 2-25 inheritance hierarchy of banking accounts Note that the classes bankaccount and checkingAccount are abstract. Thar is, we cannot instantiate obyects of these classes. The other classes in Figure 12-25 are not abstract. bank account has a bankAccount: Every number. the name the owner, and a balance. Therefore, installe variables sucl as name. accountNumber, and balance should be declared in the abstract class bankAccount. Some operations common to all types of accounts are retrieve account owner's name, account number, and account balance; make deposits; withdraw money; and create monthly statements. So include functions to implement these operations. Some ofrhese finnctions will he pure virnal. checkingAccount: A checking accoun is a bank account. Therefore, it inherits all the properties of a bank account. Because one of the objectives of a checking account is to be able to write checks. include the pure virul function writeCheck to write a check erwiaechargerChealkina. AA Mare

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions