Revise the baseDMA-lacksDMA-hasDMA class hierarchy so that all three classes are derived from an ABC. Test the
Question:
Revise the baseDMA-lacksDMA-hasDMA class hierarchy so that all three classes are derived from an ABC. Test the result with a program similar to the one in Listing 13.10. That is, it should feature an array of pointers to the ABC and allow the user to make runtime decisions as to what types of objects are created. Add virtual View() methods to the class definitions to handle displaying the data.
Listing 13.10.
Transcribed Image Text:
Listing 13.10 usebrass2.cpp
// usebrass2.cpp
// compile with brass.cpp
#include
Listing 13.10 usebrass2.cpp
// usebrass2.cpp
// compile with brass.cpp
#include
#include
#include "brass.h"
const int CLIENTS = 4;
int main()
{
--
using std::cin;
using std::cout;
using std::endl;
polymorphic example
Brass p_clients [CLIENTS];
std::string temp;
long tempnum;
double tempbal;
char kind;
for (int i = 0; i < CLIENTS; i++)
{
cout<<"Enter client's name: ";
getline (cin, temp);
cout<<"Enter client's account number: "
cin >> tempnum;
cout << "Enter opening balance: $";
cin >> tempbal;
cout << "Enter 1 for Brass Account or "
<< "2 for BrassPlus Account: ";
while (cin >> kind && (kind != '1' && kind != '2'))
cout <<"Enter either 1 or 2: ";
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 42% (7 reviews)
class Brass protected double balance public Brassconst stdstring s Nullbody long an 1 double bal 00 ...View the full answer
Answered By
Dennis Nyangau
I have been tutoring for several years now, and I absolutely love it! I love being able to help students one-on-one and see them succeed. It is so gratifying to see a student understand a concept that they were struggling with before. I also enjoy getting to know my students and helping them to reach their full potential.
0.00
0 Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
In an study similar to the one in Exercise 3, the relative humidity and ozone levels were measured for 120 days in another city. The MINITAB output follows. Assume that assumptions 1 through 4 on...
-
Write an JavaFx application similar to the one in Listing 1.2 that displays a picture of a snowman. Draw three circles, one above the other. Make the circles progressively smaller from bottom to top....
-
A jacketed vessel similar to the one in Exercise 2.8 is used to heat a liquid by means of condensing steam. The following information is available: (i) The volume of liquid within the tank may vary....
-
Assume that on July 1, 2014, Big Corp. loaned little Corp. $12,000 for aperiod of one year at 6percent interest. What amount of interest revenue will big report for 2014? What amount of cash will big...
-
After the reunification of Germany in 1990, payments to rebuild the East led to a major expansion of aggregate demand in Gennany. The Gennan central bank responded by slowing money growth and raising...
-
What are the effects of organizational justice perceptions on employee trust and cooperation? How do psychological contracts influence employee expectations and organizational obligations?
-
The composite aluminum 2014-T6 bar is made from two segments having diameters of \(7.5 \mathrm{~mm}\) and \(15 \mathrm{~mm}\). Determine the maximum height \(h\) from which the 10-kg collar should be...
-
When Johnson Hardware Shop borrowed $20,000 from First Bank, it used its inventory as collateral for the loan. First Bank perfected its security interest by filing a financing statement. The...
-
Bonnie and Jake (ages 35 and 36, respectively) are married with no dependents and live together in Montana (not a community property state). Because Jake has large medical expenses, they seek your...
-
Tyler Tooling Company uses a job order cost system with overhead applied to products on the basis of machine hours. For the upcoming year, the company estimated its total manufacturing overhead cost...
-
Do Programming Exercise 6 but modify it to get information from a file. The first item in the file should be the number of contributors, and the rest of the file should consist of pairs of lines,...
-
Which member functions are special member functions, and what makes them special?
-
What are the differences between a microhedge and a macrohedge for an FI? Why is it generally more efficient for FIs to employ a macrohedge than a series of microhedges?
-
Explain you chose content marketing as your topic and why it is important. Identify the audience to which you have directed your content marketing infographic. Explain why this audience may have an...
-
A 10 MVA, 22 kV star connected alternator has armature resistance of 0.5 ohm. The machine is supplying 90 A current at zero pf leading when the terminal voltage is 25 kV. Under this condition, if the...
-
If a company's revenues are greater than its expenses, increasing its revenues and decreasing what is its expenses?
-
Jorge and Anita, married taxpayers, earn $151,600 in taxable income and $40,400 in interest from an investment in City of Heflin bonds. Using the U.S. tax rate schedule for married filing jointly,...
-
Consider a project that requires spending of $15,000 immediately and generates $6,000 per year for the next 4 years (assume each $6,000 comes at the end of each year).What is the NPV of this project?...
-
In air under ordinary conditions (room temperature and atmospheric pressure), the average intermolecular distance is about 4 nm and the mean free path is about 0.1 m. The diameter of a nitrogen...
-
Three successive resonance frequencies in an organ pipe are 1310, 1834, and 2358 Hz. (a) Is the pipe closed at one end or open at both ends? (b) What is the fundamental frequency? (c) What is the...
-
What is the expected running time of the methods for maintaining a maxima set if we insert n pairs such that each pair has lower cost and performance than one before it? What is contained in the...
-
Consider the following variant of the findIndex method of the SortedTableMap class, originally given in Code Fragment 10.11: Does this always produce the same result as the original version? Justify...
-
Implement the containKey(k) method, as described in Exercise R-10.3, for the SortedTableClass.
-
Design a power transmission system to connect a DC motor to its load. The motor is given in the motor catalogue as a BM1400 motor. You must create a transmission which will connect to this motor and...
-
SDJ, Incorporated, has net working capital of $3,320, current liabilities of $4,550, and inventory of $4,600. a. What is the current ratio? b. What is the quick ratio?
-
Calculate the final selling price to the nearest cent and markdown percent to the nearest hundredth percent: Original selling price $4,900 First markdown 20% Second markdown 10% Markup 12% Final...
Study smarter with the SolutionInn App