Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

net beans and i need a screen shot of the output Q1: Write appropriate code that implements the following requirements. To save time, don't worry

image text in transcribednet beans and i need a screen shot of the output

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 b1 = 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.GetMostExpensive()); //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 // many books pmuLib.AddBook (b3, 100);// It 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: // (1) someone adds only one book with 1000 copies: pmuLib.AddBook (b1, 1000); // (2) someone adds 1000 different books each with 1 copy: pmuLib.AddBook (b1, 1); pmuLib.AddBook (b2, 1); pmuLib.AddBook (b3, 1); // pmuLib.AddBook (b1000, 1); } }

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

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What are the best practices for managing a large software project?

Answered: 1 week ago

Question

How does clustering in unsupervised learning help in data analysis?

Answered: 1 week ago

Question

4. Who would lead the group?

Answered: 1 week ago