Question: in java public class Book from previous asssignment below public class Book { // Declaring instance variables private String author; private String title; private int
in java



public class Book from previous asssignment below
public class Book {
// Declaring instance variables
private String author;
private String title;
private int noOfPages;
private boolean status;
// Parameterized constructor
public Book(String title, String author, int noOfPages) {
this.author = author;
this.title = title;
this.noOfPages = noOfPages;
this.status = false;
}
// getters and setters
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getNoOfPages() {
return noOfPages;
}
public void setNoOfPages(int noOfPages) {
this.noOfPages = noOfPages;
}
public boolean isStatus() {
return status;
}
public void setStatus(boolean status) {
this.status = status;
}
// toString() method is used to display the contents of an object
@Override
public String toString() {
return title + ", " + author + ", " + noOfPages + ", " + status;
}
}
For this assignment you are to develop a program to manage the book holdings of a small virtual library. Your virtual library program should utilize the custom class for books (the Book class) developed in your solution to Assignment 2 The virtual library program should simulate the book lending transactions that take place within a real library. To do so it should perform the following tasks . Create Book objects to represent the books in your virtual library. As the Book objects are created, use the constructor for the Book class to initialize the author, title, and number of pages attributes. Your virtual library should contain at least the following 5 Book objects (you can add additional ones if you like) "Gone with the Wind", "Margaret Mitchell", 833 pages "Of Mice and Men", "John Steinbeck", 112 pages "A Tale of Two Cities", "Charles Dickens", 304 pages "1984", "George Orwell", 328 pages "Tipping Point", "Malcolm Gladwell", 301 pages o o o o o
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
