Write C++ program of the following question. The following class diagram represents a library system that...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write C++ program of the following question. The following class diagram represents a library system that records the books that have been borrowed. There are three kinds of books: regular books, reference books, and audio books. • Reference books can be taken out for just two days, while other kinds of books may be borrowed for two weeks. The overdue fees are 10 cents per day for reference books and regular books, and 20 cents per day for audio books. › Audio books and regular books have both authors and titles; reference books only have titles. In the library system, the day when a book is taken out and the day it is due are counted as the number of days since the library opened on New Year's Day in 2023. For example, if an audio book was recently taken out, it would be recorded as taken out on the 1st day of 2023, and its due date would be on the 15th day of 2023. Book | IBook | 71 www - 1 | | RefBook || AudioBook | | String title | | String title | | String title | | String author | int dayTaken | | String author| int dayTaken | +-----+int day Taken | • Design the interfaces and classes that represent the library borrowing system. • Define the abstract class ABook and lift those fields that can be lifted to this class. • Design the method daysOverdue that consumes the number that represents today in the library date-recording system and produces the number of days this book is overdue. If the number is negative, the book can still be out for that many days. • Design the method isOverdue that produces a boolean value that informs us whether the book is overdue on the given day. • Design the method computeFine that computes the fine for this book, if the book is returned on the given day. • For all methods, think carefully whether they should be designed being implemented solely in the abstract class, implemented solely in the concrete classes, or implemented in the abstract class and then overridden in some of the concrete classes. Write C++ program of the following question. The following class diagram represents a library system that records the books that have been borrowed. There are three kinds of books: regular books, reference books, and audio books. • Reference books can be taken out for just two days, while other kinds of books may be borrowed for two weeks. The overdue fees are 10 cents per day for reference books and regular books, and 20 cents per day for audio books. › Audio books and regular books have both authors and titles; reference books only have titles. In the library system, the day when a book is taken out and the day it is due are counted as the number of days since the library opened on New Year's Day in 2023. For example, if an audio book was recently taken out, it would be recorded as taken out on the 1st day of 2023, and its due date would be on the 15th day of 2023. Book | IBook | 71 www - 1 | | RefBook || AudioBook | | String title | | String title | | String title | | String author | int dayTaken | | String author| int dayTaken | +-----+int day Taken | • Design the interfaces and classes that represent the library borrowing system. • Define the abstract class ABook and lift those fields that can be lifted to this class. • Design the method daysOverdue that consumes the number that represents today in the library date-recording system and produces the number of days this book is overdue. If the number is negative, the book can still be out for that many days. • Design the method isOverdue that produces a boolean value that informs us whether the book is overdue on the given day. • Design the method computeFine that computes the fine for this book, if the book is returned on the given day. • For all methods, think carefully whether they should be designed being implemented solely in the abstract class, implemented solely in the concrete classes, or implemented in the abstract class and then overridden in some of the concrete classes.
Expert Answer:
Related Book For
Accounting Information Systems
ISBN: 978-0133428537
13th edition
Authors: Marshall B. Romney, Paul J. Steinbart
Posted Date:
Students also viewed these programming questions
-
Briefly explain the different central bank intervention mechanisms, then assess how they are used in the current context and how the range of these tools has evolved to deal with the current...
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
How many of the following could be valid JDBC URL formats for an imaginary driver named magic and a database named box? A. Only first B. Only second C. Only third D. first and second E. first and...
-
Find the area of the surface obtained by rotating the given curve about the -axis. 39. x - 4vi. y-+ 1
-
On September 25, Bramble provided services to two clients and billed the clients a total of $700. On October 15, both clients paid their invoice in full. Bramble's cost related to this sale was $430...
-
Explain when it is appropriate to use a randomized block design.
-
Bills Wrecker Service has just completed a minor repair on a tow truck. The repair cost was $1,550, and the book value prior to the repair was $6,500. In addition, the company spent $12,000 to...
-
8.4 Static Equilibrium -3L/4- L/4- F -Axis of rotation y mg F2 56. Calculate If the two parents in Figure 8.19 exert upward forces of 18 N on the left end of the plank and 71 N on the right end, how...
-
In Part III (Appendix 11B) of the audit case, the audit staff of Adams, Barnes & Co. identified specific revenue risks on working paper RA-12 (page 494). However, the Summary of Audit Approach...
-
If you enter a number from 1 to 6 in cell B4, the corresponding colour, based on the table in the worksheet, will be shown in cell B5. Here is the formula in cell B5. (84, B1:G2, 2) What is the cell...
-
A foreign currency is currently worth $0.64. A one-year butterfly spread is set up using European call options with strike prices of $0.60, $0.65, and $0.70. The risk-free interest rates in the...
-
Suppose you buy a put option contract on October gold futures with a strike price of $1,200 per ounce. Each contract is for the delivery of 100 ounces. What happens if you exercise when the October...
-
A U.S. company knows it will have to pay 3 million euros in three months. The current exchange rate is 1.1500 dollars per euro. Discuss how forward and options contracts can be used by the company to...
-
Kauffman created a corporation to hold certain assets in a manner intended to minimize tax liability. After creation of the corporation, a judgment was entered against Kauffman as a result of a...
-
Between October 30, 2017, and November 1, 2017, you have a choice between owning a U.S. government bond paying a 12% coupon and a U.S. corporate bond paying a 12% coupon. Consider carefully the day...
-
It is desired to have $9000 available 12 years from now. If $5000 is available for investment at the present time, what discrete annual rate of compound interest on the investment would be necessary...
-
You've been asked to take over leadership of a group of paralegals that once had a reputation for being a tight-knit, supportive team, but you quickly figure out that this team is in danger of...
-
Which parts of Figure would accurately depict almost every organizations revenue cycle? Which parts would change? Take Customer Order Employee Inventory Customer Sale Employee Receive Cash Customer...
-
Nino Moscardi, president of Greater Providence Deposit & Trust (GPD&T), received an anonymous note in his mail stating that a bank employee was making bogus loans. Moscardi asked the banks internal...
-
As manager of a local pizza parlor, you want to develop a balanced scorecard so you can more effectively monitor the restaurants performance. Required a. Propose at least two goals for each...
-
Using the potential theory obtain the damping for a cycle of (i) plunge, (ii) pitch oscillations.
-
Obtain the vortex lift line slope, given by Eq. 8.14, for a supersonic delta wing. Eq. 8.14 Ky = -(cos A) ?
-
The state-space representation is based on a state function \(x\) satisfying the first order ODE \(\tau_{1} \dot{x}=x_{o}\left(\alpha-\tau_{2} \dot{\alpha} ight)-x\), where argument...
Study smarter with the SolutionInn App