Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

02) write a java program with the following steps: 1- Create a java class tile Book which has the folowing properties Back lite:Suing -price.double -Category:

image text in transcribed

02) write a java program with the following steps: 1- Create a java class tile Book which has the folowing properties Back lite:Suing -price.double -Category: String -authorName: Author + Constructors (you should include all the needed constructors) +getters and setters you should include the setters and getters needed for data members) override method toString String (represent the book with all its information override method equals(Book by boolean (it will check the quality of any two books according to their title) Note: Category data mernber takes historical, Health, or acadernic value. 2- Create another java cless tie Author which has the folowing properties: Author -name:String -gender:String +constructors (you should include all the needed constructors) +getters and setters you should include the setters and getters needed for cala members) +override method toString()-String (represent the author with at his/her information) toverride method equals(Author a:boolean (it wil check the quality of any two authors according to ther name and gender Note: gender dala member takes Male or Female value. 3- Create java main class file Test1 and do the following: A) Decare an array aliBooks of type book with size 3 B) Print the following menu to give the user optionally Choose 1 to insert a new book Choose 2 to retrieve historical books. Choose 3 to check the equality of first and last books in the array Choose to exit. C) When the user chooses the first choice, you should check the ailBooks array if it is full then give him her a sorry, you reach the maximum length' message else prompt from the user to enter full information for the new book title, price, type, and the info of author (name and gender) then print all the books with the new one. D) When the user chooses the second choice, you should retrieve the information of all the backs with history type. E) When the user chooses the last choice, you should check the equality of the first book with the last book in the array by using the override method equals fin Book class). Sample Run Choose 1 to insert a new book Chocise 2 to retrieve history books, Choose 3 to check the quality of first and last books in the array Choose to axit Please enter your choices 1 Please enter the title: Introduction to java programming. Please enter the pre 35 Please enter the type: Academic Please enter the author name: Dietel Liang Please enter her gender Male The allBooks array contains: Introduction to java programming 35 his author Dictal Liang Male Choose 1 to insert a new book Choose 2 to retrieve history books. Choose 3 to check the equality of first and last books in the array Choose to exit. Please enter your choice: 1 Please enter the title: History of the Caliphs Please enter the price 57 Please enter the type: Historical Please enter the author name Jalaluddin Al-Suyuti Please enter har gender: Male The allBooks array contains: Introduction to Java programming 35 Academic his author Dietel Liang Male History of the Caliphs 57 Historical his author Jalaluddin Al-Suyuti Male

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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