Question: Create a Book class with the following attributes and methods: Attributes: title ( String ) author ( String ) publicationYear ( int ) ISBN (

Create a Book class with the following attributes and methods:
Attributes:
title (String)
author (String)
publicationYear (int)
ISBN (String)
available (boolean)
price (double)
totalAvailableBooks (int, static)
Methods:
Constructor: To initialize each field with given parameters, and increments totalAvailableBooks.
Mutators for each field
Accessors for each field
totalAvailableBooks(): returns the value of totalAvailableBooks
displayInfo(): Prints the details of the book, including title, author, publication year, ISBN, availability, and price.
borrowBook(): Sets the availability status to false if the book is available and decrements totalAvailableBooks; otherwise, prints a message indicating that the book is already borrowed.
returnBook(): Sets the availability status to true if the book is currently not available, and increments totalAvailableBooks; otherwise, prints a message indicating that the book is already in the library.
calculateLateFee(int daysOverdue): Takes the number of days a book is overdue as a parameter and calculates the late fee. Assume a fixed late fee of $0.50 per day overdue. Print a message indicating the late fee.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!