We need to implement and use a class that manages books. This class is called Book...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
We need to implement and use a class that manages books. This class is called "Book" and has the following attributes: 1. ISBN number (long) 2. Title (char *) 3. Pages Also, this 'Book' class should include: • setters and getters for the above attributes. • a default constructor that receive no parameters • another constructor that receives three parameters: 1) ISBN and 2) Title, and 3) the number of pages. a destructor that delete all dynamically allocated objects. • A method to set the content of a certain page. The method should receive the page number and the content to be added to the page. • A method to get the content of a certain page. Note that 'Pages' data member is an array of type 'Page'; • you should also build that class 'Page'. • This Page class should contain at least one data member for the page number and another for the page content. In the main method, show how to create a new Book dynamically, calling the second constructor with suitable arguments. Also, in the main function, you should show how to add new pages with new content, and to print the content of existing pages. We need to implement and use a class that manages books. This class is called "Book" and has the following attributes: 1. ISBN number (long) 2. Title (char *) 3. Pages Also, this 'Book' class should include: • setters and getters for the above attributes. • a default constructor that receive no parameters • another constructor that receives three parameters: 1) ISBN and 2) Title, and 3) the number of pages. a destructor that delete all dynamically allocated objects. • A method to set the content of a certain page. The method should receive the page number and the content to be added to the page. • A method to get the content of a certain page. Note that 'Pages' data member is an array of type 'Page'; • you should also build that class 'Page'. • This Page class should contain at least one data member for the page number and another for the page content. In the main method, show how to create a new Book dynamically, calling the second constructor with suitable arguments. Also, in the main function, you should show how to add new pages with new content, and to print the content of existing pages.
Expert Answer:
Answer rating: 100% (QA)
bookcpp include include using namespace std class Page private string pageContent int pageNum public ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
The Addington Book Company has the following equity position. The stock is currently selling for $3 per share. Common stock (8 million shares outstanding, $2 par) .......... $16,000,000 Paid in...
-
Pages Books Inc. (Pages) operates a national chain of book stores in Canada. Pages offers gift cards for sale for customers who would like to give a gift of books but who aren't sure what titles they...
-
We also have data on the protein content on the 77 cereals in Exercise 45. Does protein content vary by shelf? Heres a boxplot and an ANOVA table. a) What kind of design or study is this? b) What are...
-
Distinguish between a National Health Insurance system and a National Health Service. Provide examples of each. What kind of a system does the United States have?
-
Rank the compounds within each of the following sets in order of increasing basicity, and explain your reasoning. (a) Pyridine, 3 - nitropyridine, 3 - chlorogyridine (b) imidazole and thiazole
-
Use Crout factorization for tri diagonal systems to solve the following linear systems. a. 2x1 + x2 = 3, x1 + 2x2+ x3 = 2, 2x2+3x3 = 0. b. 2x1 x2 = 5, x1 + 3x2 + x3 = 4, x2 + 4x3 = 0. c. 2x1 x2 =...
-
A certain underlying state graph is a tree where each node has three successor nodes, indexed \(a,b, c\). There are two assets defined on this tree which pay no dividends except at the terminal time...
-
Assume that both portfolios a and b are well diversified? that E(rA)=12% and E(rB)=9%. If the economy has only one factor and beta=1.2 whereas beta=.8, what must be the risk-free rate?
-
If I assume the WACC= 9% and a growth rate of 5% after year 1. What would the FCF for Year 1 be? What would the market value of the common stock be? 3. ($ millions) Sales Actual Forecast X 0 Xr1 $...
-
A venturi meter similar to the one in Fig. 15.2 is attached to a 4-in Schedule 40 steel pipe and has a throat diameter of 1.50 in. Determine the pressure difference across the meter that would be...
-
Determine (a) the loop inductance and (b) the capacitance of a 1 km length of single- phase twin line having conductors of diameter 10 mm and spaced 800 mm apart in air.
-
A bottle has a capacity of 1.2 L. If the density of ether is 0.74 g/mL, what mass of ether can the bottle hold
-
9 mole 9 A=97.80- G=131.29- mole 9 mole 9 mole D=141.98- X = 36.51- 9 mole E 355.68- Z= 35.04-9 mole A canister of gas contains 29.92 grams of gas A, 6.99 grams of gas D and 90.46 grams of gas G. The...
-
Over coffee and croissants at breakfast one day, your friend Juan (an expert chemist) says this: "Metal sulfides roasted with oxygen produce the corresponding oxide and sulfur dioxide gas." Using...
-
Element Li N O Ca Br S CI K Mg Be # Valence Electrons Mg Be 1 5 Name: Ions Worksheet # Electrons to gain # Electrons to lose None 3 Questions: +1 1. If Li loses an electron to another atom, why is it...
-
What is the formula mass of HCI (include units). A. 18 g/mol OB. 36.5 g/mol C.36.5 grams D. none are correct OE. 18 grams
-
CAS N3 (Rpartition du Capital) Les Capitaux propres de la S.A.R.L DILAMI au 31/12/ 2020, se prsentent comme suit avant la rpartition des bnfices : * Capital Social (4.500 actions) : 144.000.000 F *...
-
A report from the college dean indicates that for the previous semester, the grade distribution for the Department of Psychology included 135 As, 158 Bs, 140 Cs, 94 Ds, and 53 Fs. Determine what kind...
-
Shelton Pharmaceuticals Inc. is planning to develop and introduce a new drug for pain relief. Management expects to sell 3 million units in the first year at $8.50 each and anticipates 10% growth in...
-
What is the fundamental motivation behind portfolio theory? That is, what are people trying to achieve by investing in portfolios of stocks rather than in a few individual stocks or in debt? What...
-
Describe the process that occurs when an investor places an order with a broker to buy or sell stocks.
-
Do an Internet search on "build operate transfer." Identify a BOT project, preferably from your home continent (e.g., AF, AS, EU, Pacific, NA, SA), and copy a small portion of what you find (a page...
-
True or False: Benefits and disbenefits must be converted to monetary values to use benefit-cost analysis.
-
Using an Internet-based search on 'build operate transfer," find an additional definition from a source other than used in Section 14.2. Copy and paste it, as well as any graphics, examples,...
Study smarter with the SolutionInn App