Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions