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: 37% (8 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...
-
Refer to Fig. 4.31. 450-mm diameter 0.45 m 1.5 m Circular view port is centered in inclined side of Oil tank. (sg = 0.85) 0.30 m 300
-
Name three examples of unethical behavior involving scheduling and state the ethical principle each violates. LO.1
-
In the code below, three processes are competing for six resources labeled A to F. a. Using a resource allocation graph, show the possibility of a deadlock in this implementation. b. Modify the order...
-
Q 7 : erit Industries has $ 1 1 0 , 0 0 0 to invest. The company is trying to decide between two alternative uses of the funds. The alternatives are: Project A Project B Cost of equipment required $...
-
The ledger of Clayton Company includes the following unadjusted balances: Prepaid Insurance $3,000, Service Revenue $58,000, and Salaries and Wages Expense $25,000. Adjusting entries are required for...
-
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?
-
a. Central bankers must manage expectations. Suppose that inflation is running at 10% and the central banker would like to lower inflation to 2% without reducing real growth. What should the central...
-
21. How a degradation process is modeled? 22.Give the homogenity property in Linear Operator 23. Give the relation for degradation model for continuous function 24.which is called the superposition...
-
28. Define Gray-level interpolation 29. What is meant by Noise probability density function? 30. Why the restoration is called as unconstrained restoration? 31. Which is the most frequent method to...
-
34. Give the relation for guassian noise 35. Give the relation for rayleigh noise 36. Give the relation for Gamma noise 37. Give the relation for Exponential noise 38. Give the relation for Uniform...
-
41. What is pseudo inverse filter? 42. What is meant by least mean square filter? 43. Give the difference between Enhancement and Restoration PART-B 1. Discuss different mean filters
-
1.Discuss different mean filters 2. Draw the degradation model and explain. 3.Write short notes on Median Filters
-
Connecting Graphs with Equations Write an equation for the graph given. Each represents a logarithmic function with base 2 or 3, translated and/or reflected. y (-2, 0) (1,-2) (-1,1)- %3 -31
-
A bubble-point liquid feed is to be distilled as shown in Figure. Use the Edmister group method to estimate the mole-fraction compositions of the distillate and bottoms. Assume initial overhead and...
-
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.
-
Your company BMG Inc. has to liquidate some equipment that is being replaced. The originally cost of the equipment is $120,000. The firm has deprecated 65% of the original cost. The salvage value of...
-
1. What are the steps that the company has to do in time of merger transaction? And What are the obstacle that may lead to merger failure? 2.What are the Exceptions to not to consolidate the...
-
Problem 12-22 Net Present Value Analysis [LO12-2] The Sweetwater Candy Company would like to buy a new machine that would automatically "dip" chocolates. The dipping operation currently is done...
Study smarter with the SolutionInn App