Question
java Create a class called Book which include five data members. 1- BookName [ String ] 2- Booktype [char] 3- publisher [string] 4- BID [
java
Create a class called Book which include five data members.
1- BookName [ String ] 2- Booktype [char] 3- publisher [string] 4- BID [ int] 5- price [double]
Provide a constructor that initializes all data members and also a pramitrized constructor. Provide a set and a get method for each data member. Provide a method display() that displays all the book information.
Provide a method check_booktype() which has these values: c = 100 e = 200 p = 300 g = 400
if the book price grater than or equal the book type, print [Price of book is more than given value] and display thr book information. otherwise print [Price of book is not more than given value] without displaying the book information.
In the main method , create 4 objects [ book1, book2, book3 and book4]
book1 [ default values] book2 [ use the constructor ] [ Book name :Introduction to Java Book type : p publisher : ABC BID : 1234 price : 200.0 ] book3 [ use setter ] book4 [ just change BID using setter by input and then display the information after the updating ]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started