Question: in 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).

in 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 1 public static void main(String[] args) 1 Book b1 = new Book ("Learn Java", 230);//title, price in SAR Book b2 new Book ("COP 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 (b1, 100); //book and quantity of books added to the library pmuLib.AddBook (b2, 2001; pmuLib.AddBook (b3, 1001; System.out.println(pmulib)://prints the whole library in nice format System.out.println("The most expensive book in the library = "+ pmulib.Gel.Most Expensive (); //It prints "OOP in Java" pmulib.AddBook (b3, 150); // It should print that library currently has // remaining capacity of 100, so can't add these V/ many books pmulib. AddBook (b3, 100); // IL should work fine /ote: if total library capacity is 1000 books then there are two cases // that tell you when the library will be full: 71 (1) someone adds only one book with 1000 copies: 7 pmulib. AddBook (b1, 1000); 7 (2) someone adds 1000 different books each with 1 copy: // pmulib.AddBook (b1, 1); pmuLib.AddBook (b2, 1); // pmul.ib. AddBook (b3, 1); // pmulib.AddBook (b1000, 1); 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
