Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help in java The goal of this coding exercise is to create two classes BookstoreBook and LibraryBook. Both classes have these attributes: author: String

please help in java
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
The goal of this coding exercise is to create two classes BookstoreBook and LibraryBook. Both classes have these attributes: author: String tilite: String lsbon 1 String The Bookstorebook has an additional data member to store the price of the book, and whether the book is on sale or not. If a bookstore book Is on sale, we need to add the reduction percentage (like 20% off...etc). For a LibraryBook, we add the call number (that tells you where the book is in the library) as a string. The call number is automatically generated by the following procedure: The call number is a string with the format xx.yyy.c, where xx is the floor number that is randomly assigned (our library has 99 floors). vyy are the finst three letters of the author's name (we assume that all names are at least three letters long), and c is the last character of the isbn. in each of the classes, add the setters, the getters, at least three constructors (of your choosing) and override the tostring method (see sample run below). Also, add a static variable is each of the classes to keep track of the number of books objects being created in your prosram. Your code should handle up to 100 bookstore books and up to 200 library books. Use arrays to store your objects. Your code should display the list of all books keved in by the user Welcome to the book program! Would you like to create a book object? (yeso): yEs Please enter the author, title ad the isbn of the book separated by /: Ericka Jones/Java made Easy/458792132 Got it! Now, tell me if it is a bookstore book or a library book (enter BB for bookstore book or LB for library book): BLB Oopsl That's not a valid entry. Please try again: Bookstore Oops! That's not a valid entry. Please try again: bB Got it! Please enter the list price of JAVA MADE EASY by ERICKA JONES: 14.99 Is it on sale? (y) : y Deduction percentage: 15% Got it! Here is your bookstore book information [458792.132 IAVA MADE EASY by EAICKA IONES, \$14.99 listed for \$12.74] I'm sorry but yeah isn't a valid answer. Please enter either yes or no: yes Please enter the author, title and the isbn of the book separated by /: Eric Jones/Java made Difficult/958792130 Got it! Now, tell me if it is a bookstore book or a library book (enter BB for bookstore book or LB for library book): LB Got it! Here is your library book information [958792130-JAVA MADE DIFFICULT bY ERIC JONES-09.ERL.0] Would you like to create a book object? (yeso): yes Please enter the author, title and the isbn of the book separated by /: Erica Jone/Java made too Difficult/958792139 Got itl. Now, tell me if it is a bookstore book or a library book (enter BB for bookstore book or LB for library book): LB Got it! Here is your library book information [958792139-IAVA MADE TOO DIFFICULT bY EAICA JONE-86.ER1.9] Would you like to create a book object? (yeso): no Surel Here are all your books... Library Books (2) [958792130-JAVA MADE DIFFICULT by ERIC JONES-09.ERI.0] [958792139-JAVA MADE TOO DIFFICULT by ERICA JONE-86.ERI.9] Bookstore Books (1) [458792132-JAVA MADE EASY by ERICKA JONES, \$14.99 listed for \$12.74] Take care now

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_2

Step: 3

blur-text-image_3

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

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

List the different categories of international employees. page 642

Answered: 1 week ago

Question

Explain the legal environments impact on labor relations. page 590

Answered: 1 week ago