Question: For assignment 3, you are to do exercise 3.9 on page 100 of our text ( C++, How to Program, 10 th ed ., Deitel

For assignment 3, you are to do exercise 3.9 on page 100 of our text (C++, How to Program, 10th ed., Deitel and Deitel, Prentice Hall, 2017b). This involves modifying the class Account so it contains a function, withdrawal, which take a positive integer as a parameter and subtracts that amount from the account's balance. If the amount of the withdrawal is greater than the balance, the balance will be unchanged and a message will be displayed indicating that the withdrawal amount is greater than the balance.

You are to accomplish this by modifying the programs in Figures 3.8 on page 90 and 3.9 on page 92. in the following ways. Name the class FMCLAccount. Store this class in the file FMCLAccount.h. Store the test program in file FMCLAccountTest.cpp.

I suggest you approach this problem as follows:

Copy the code in Figures 3.8 and 3.9 into the appropriate files, changing the name of the class. The file names are to be FMCLAccount and FMCLAccoutTest.cpp. Get the programs to work.

Add the function withdrawal to account FMCLAccount.

Add to FMCLAccountTest.cpp the code needed to test the withdrawal function. (Do not remove any of the code that tests the other functions.) Be sure to test for both valid and invalid withdrawal amounts.

In the file FMCLAccount.h include as a comment the UML diagram for your class. (Note the horizontal lines can be made with --- or ____ and the vertical with |. They do not need to form solid lines.)

After the UML diagram include as a comment the pseudocode for the withdrawal class.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!