Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please write in java ABC Bookstore started its operation by selling physical and digital books. Each book has its ISBN, title, and quantity. The company

image text in transcribed

image text in transcribed

please write in java

ABC Bookstore started its operation by selling physical and digital books. Each book has its ISBN, title, and quantity. The company is planning to develop an application that can calculate an estimate price of books to forecast the profit. Estimated price for digital books depending on the size of memory (in kilobyte) consumed. A 10% discount is given to all digital books for every purchase on 22nd July annually in conjunction with digital awareness day. Estimated price of physical books is related to the number of pages and book's hardcover. Book ISBN: String - title : String - quantity: int + Book(String, String int) + setBook/String String, int) : void + gelQuantity): double + estimatedPrice) double + toString: String Date - day: String - month: String -year: String + Date/String, String, String) gelDay): String + et Month(): String + cetYear: String DigitalBook - memorySize : int -dt: Date + DigitalBook/String, String, int int, Date) + set DigitalBook/String, String, int, int, Date): vold - getDate(): String estimatedPrice: double -toString String Physical Book - numPage : int - hardcover: boolean + PhysicalBook(String, String, int, int, boolean) setPhysicalBook/String, String, int, int, boolean): void + estimatedProel: double + toString); String Write a complete class definition according to information given in UML template of each class that shown the above diagram. The superclass book is an abstract class that have an abstract method named estimate Price (). PhysicalBook and DigitalBook are the two subclasses that under Book as a superclass. Date class is an inner class (composite) for DigitalBook as an outer class. for both subclasses are based on the The definition of method estimatedPrice () information given in the following tables: Size of memory (kilobyte) Charge (RM) Less than 200 30.00 200-500 100.00 Every additional 30 kilobyte after 500 3.00 10% discount for purchases on 22nd July. Example date formatting is 22072021 (DayMonth Year). Number of pages Charge (RM) Less than 100 30.00 100 - 200 60.00 Every additional 30 pages after 200 5.00 * Extra charge is RM10.00 for hardcover. Write the complete application program that can do the following tasks. i. Declare an array of object to store 100 objects of Book. ii. Using the sentinel concept, read the data until the user says no longer to read the data ii. Count and display the total number for each Digital and Physical book stored iv. Calculate and display the total of estimated price of all purchases on 22nd July. v. Count and display the number of books that has hardcover. vi. Display the information about every hardcover book

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

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

Why must entrepreneurs learn to think globally?

Answered: 1 week ago