Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use java thanks You are required to write a program for part a, b, c and d below to compute royalty for Times &

image text in transcribedplease use java thanks

You are required to write a program for part a, b, c and d below to compute royalty for Times & Times Sdo Bbd, books. a) Write a class called Book which defines library book objects with the following specification in the questions below.+ Assume that each book's data will consist of its tite (type: String) its author (type 'String)+ its cost (type "double its loan status Y" or 'N') (3 marks) b) A Book class is to have methods for the following tasks: Aconstructor (with four parameters) that allows a user to initialize a book with some actual data and the loan status to Y" indicating the book is in the library. (2 marks) (2 marks)* Borrow the book (example: setting the variable gnlan to or 'N')(2 marks) Return the book (example: setting the variable onLoan to 'Y or 'N) (2 marks) (2 marks) (2 marks)* i. ii. Accessor methods for title, author, gnLoan and cost. iv. v. vi. Check if a book is available for loan Display book details c) Academic class contains academic books such as text books, reference books and journals. " Academic Book Properties Publisher- example: Mc. Graw Hill, Prentice Hall, etc. ISBN No-example: 978-0-93939-9393-3 Published Year - example: 2010 i. Create a new class named Academic extending the Book class adding appropriate instance variables for storing publisher, ISBN No and published year variables Provide appropriate accessors and mutators for the above instance (6 marks)* i. Write a constructor that takes as arguments values for publisher, ISBN No and published year setting the corresponding instance variables either directly or by calling the superclass constructor (4 marks)* Write a method called computeRoyaltwith the specification below to compute and return the royalty a publisher must grant author(s) of a given book. You may assume the current year as 2013. (7 marks)

Step by Step Solution

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

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

x-3+1, x23 Let f(x) = -*+3, * Answered: 1 week ago

Answered: 1 week ago

Question

Question What is a Roth 401(k) feature?

Answered: 1 week ago