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...
-
At a certain location, the Earth's magnetic field has a magnitude of 5.4 10-5 T and points in a direction that is 68 below the horizontal. Find the magnitude of the magnetic flux through the top of...
-
Please provide answers and codes that work on Rstudios to this question This dataset contains the locations and names of 3,721 short tandem repeat markers, or "STRs" on human chromosome 22, along...
-
Some of your classmates are boasting that they can make a killing by trading stocks over a short period of time.
-
The fieldwork for the June 30, 2013, audit of Tracy Brewing Company was finished August 19, 2013, and the completed financial statements, accompanied by the signed audit reports, were mailed...
-
Flashcards Math Solver Internships Study Pack Find solutions for your homework Search home / study / business / accounting / accounting questions and answers / barry potter and winnie weasley...
-
The text used Poissons equation to show that the charge density of a point electric dipole with moment p located at the point r 0 is D (r) = p (r r 0 ). (a) Derive the given formula for D (r)...
-
Your company, Healthy Gyms Limited, owns and manages a number of gyms and fitness centers around the state. Your boss has asked for your help with the following: Customers have unlimited use of the...
-
b. Winnie the Pooh wants to fill 5 pots of honey each day. Each pot holds 2.0 liters of honey. Pooh can get 500. cm3 of honey out of each beehive. How many beehives must he empty in order to fill his...
-
Where does transcription occur in a eukaryotic cell? Where doestranslation occur? Examine Fig. 10.5. How is transcription similar to DNAreplication? How is it different? What are introns and exons?...
-
In this problem, you will apply kinematic equations to a jumping flea. Take the magnitude of free - fall acceleration to be 9 . 8 2 m / s 2 . Ignore air resistance. Part A A flea jumps straight up to...
-
Emily Patterson is a Caucasian human services student and currently works as a visitation worker. She picks up children in foster care from their foster homes and brings them to the agency where they...
-
Copper (II) sulfide (CuS) is only slightly soluble in water (Ksp= 1.27 x 10-36). A scientist has prepared 300.00 mL of a saturatedaqueous solution of copper (II) sulfide for theirexperiments. a. What...
-
In 30 years, you plan to set up a fellowship fund for your university that pays out $100,000/year in perpetuity with an annually compounded discount rate of 5%. In order to set up the fund in 30...
-
As you rewrite these sentences, replace the cliches and buzzwords with plain language (if you don't recognize any of these terms, you can find definitions online): a. Being a jack-of-all-trades, Dave...
-
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...
-
Unit Conversion. 1 kilogram (kg) is equal to 2.20462 pounds. Convert 200 pounds to kilograms. Round to three decimal places, if necessary.
-
In this exercise, we explore what happens when an item is marked up by a percentage, and then marked down using the same percentage. Wegmans purchases an item for \(\$ 5\) per unit. The markup on the...
-
Unit Conversion. There are 1,000 meters \((\mathrm{m})\) in a kilometer \((\mathrm{km})\), and 100 centimeters \((\mathrm{cm})\) in a meter. Convert \(4 \mathrm{~km}\) to centimeters.
Study smarter with the SolutionInn App