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...
-
A solid gold bar is pulled up from the hold of the sunken RMS Titanic. (a) What happens to its volume as it goes from the pressure at the ship to the lower pressure at the ocean's surface? (b) The...
-
The following cost data, which include operating cost and depreciation of capital investment, pertain to Exercise 9.1. Determine by finding the total cost for each of the 14 possible sequences: (a)...
-
Enter the following transactions in a sales journal. Use a 6% sales tax rate. May 1 Sold merchandise on account to J. Adams, $2,000, plus sales tax. Sale No 488. 4 Sold merchandise on account to B....
-
What are the challenges associated with heat transfer in compact heat exchangers, and how do innovations in materials science and additive manufacturing contribute to overcoming these challenges ?
-
Use the given below to answer items 4 and 5: Given 4 distinct points, W, X, Y, Z on a line a. To prove that there exists a projectivity which carries W, X, Y, Z into X, W, Z, Y, consider the outline...
-
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 three features of comovement that macroeconomists are interested in?
-
You are a maintenance technician in the gum wrapping section for eclipse gum and the machines you are responsible for fixing work seamlessly compared to the ones in the gum-making section. you...
-
The owner of a restaurant is examining its use of eggs. Based upon past experience, the owner believes that daily egg use is distributed normally with a mean of 56 and a standard deviation of 11....
-
Draw the sketches to indicate the conventional representation of the following: (a) A coarse ISO metric V-threaded rod of nominal diameter 10mm and thread length 25mm.(Take H=0.866p) (b) A threaded...
-
12) Christopher sells ATVs in the Baton Rouge area. His commission is based on his monthly sales. Sales generated First $0 to $40,000 7.5% Next $40,000 9% All sales above $80,000 10% Calculate...
-
A test requires that you answer first Part A and then either Part B or Part C. Part A consists of 7 true/false questions, Part B consists of 9 multiple choice questions with one correct answer out of...
-
How many elements are in the union of four sets if the sets have 50, 60, 70, and 80 elements, respectively, each pair of the sets has 5 elements in common, each triple of the sets has 1 common...
-
6. (Potential Energy and Conservation of Energy) What should be the spring constant k of a spring designed to bring a 1200-kg car to rest from a speed of 95 km/h so that the occupants undergo a...
-
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.
-
es Hart, Attorney at Law, experienced the following transactions in Year 1, the first year of operations: 1. Accepted $16,600 on April 1, Year 1, as a retainer for services to be performed evenly...
-
Dahlia Corporation has a current accounts receivable balance of $439,516. Credit sales for the year just ended were $5,503,810. a. What is the receivables turnover? Note: Do not round intermediate...
-
Why does the organizational structure hold political significance? Provide an in-depth analysis of this concept using examples from both academic literature and real-world instances. Additionally,...
Study smarter with the SolutionInn App