Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write C++ program of the following question. The following class diagram represents a library system that records the books that have been borrowed. There

Write C++ program of the following question. The following class diagram represents a library system that Book | IBook | 71 www - 1 | | RefBook || AudioBook | | String title | | String title || String title | |

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.

Step by Step Solution

3.41 Rating (148 Votes )

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting Information Systems

Authors: Marshall B. Romney, Paul J. Steinbart

13th edition

133428532, 978-0133428537

More Books

Students also viewed these Programming questions

Question

Describe the key steps in writing papers for college.

Answered: 1 week ago

Question

Identify four methods of studying.

Answered: 1 week ago