Question: Write a C++ class declaration for the following Checkbook ADT (Abstract Data Type). Do not implement the ADT other than to include in the class
Write a C++ class declaration for the following Checkbook ADT (Abstract Data Type). Do not implement the ADT other than to include in the class private access a concrete data member that is to be used to represent the current balance. All monetary amounts are to be represented as floating-point numbers. Here is the general specifications for the Checkbook ADT that might be useful for declaring the class for use in a program. (2 pts) TYPE Checkbook DOMAIN Each instance of the Checkbook type is a value representing one customers current checking account balance. OPERATIONS Open the checking account, specifying an initial balance. Write a check for a specified amount. Deposit a specified amount into the checking account. Return the current balance. ANSWER: 2. Implement the following Checkbook member functions by writing the class member function procedures outside of the class specification (4 pts) a. Open b. MakeDeposit c. WriteCheck d. CurrentBalance ANSWER: Write a segment of client code that declares two Checkbook objects, one for a personal checkbook and one for a business account. (1 pt) ANSWER: For the personal checkbook in Question 3, write a segment of client code that opens the account with an initial balance of $300.00, writes two checks $50.25 and $150.00, deposits $87.34 into the account, and prints out the resulting balance. (1 pt) ANSWER: For the Checkbook class, replace the Open function with two C++ class constructors. One (the default constructor) initializes the account balance to zero. The other initializes the balance to an amount passed as an argument. (2 pts) a. Revise the class declaration. b. Implement the two class constructors. ANSWER: ----------------------------------------------------------------------------------- Using a text editor (such as notepad or textedit) neatly type your responses to the five questions along with any related code snippets, appropriate documentation and upload it as a text file using this file upload area below.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
