Question: java Q1: Write appropriate code that implements the following requirements. To save time, don't worry about private members and the corresponding getters(accessors) and setters(mutators). Implement

 java Q1: Write appropriate code that implements the following requirements. To

java

Q1: Write appropriate code that implements the following requirements. To save time, don't worry about private members and the corresponding getters(accessors) and setters(mutators). Implement only the necessary requirements. Upload one file with your code and screenshot of the output. public class Main public static void main(String[] args) { Book bi = new Book ("Learn Java", 230)://title, price in SAR Book b2 = new Book ("OOP in Java", 310); Book b3 = new Book ("Learn OOP in C++", 290); Library pmulib = new Library(500); //total books that this library can hold pmuLib.AddBook (bi, 100);//book and quantity of books added to the library pmuLib.AddBook (b2, 200); pmuLib.AddBook (b3, 100); System.out.println (pmuLib);//prints the whole library in nice format System.out.println("The most expensive book in the library = "+ pmuLib. GetMost Expensive()); //It prints "OOP in Java" pmuLib.AddBook (13, 150):// It should print that library currently has // remaining capacity of 100, so can't add these // many books pmuLib.AddBook (13, 100); // It should work fine 1ote: if total library capacity is 1000 books then there are two cases 1/that tell you when the library will be full: 11 (1) someone adds only one book with 1000 copies: pmuLib. AddBook (bi, 1000); 11 (2) someone adds 1000 different books each with 1 copy: pmulib. AddBook (bi, 1); pmulib. AddBook (b2, 1); pmuLib. AddBook (3, 1); pmuLib.AddBook (b1000, 1); 3 }

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!