Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions

Question

DESCRIBE the five basic elements of compensation for managers.

Answered: 1 week ago

Question

a. Do team members trust each other?

Answered: 1 week ago

Question

a. How will the leader be selected?

Answered: 1 week ago