subject

Create an abstract class named Book. Include a String field for the book’s title and a double field for the book’s price. Within the class, include a constructor that requires the book title, and add two get methods—one that returns the title and one that returns the price. Include an abstract method named setPrice(). Create two child classes of Book: Fiction and NonFiction. Each must include a setPrice() method that sets the price for all Fiction Books to $24.99 and for all NonFiction Books to $37.99. Write a constructor for each subclass, and include a call to setPrice() within each. Write an application demonstrating that you can create both a Fiction and a NonFiction Book, and display their fields.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 01:30, shelley3135
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 2
image
Computers and Technology, 23.06.2019 23:30, jamalchris9353
Worth 50 points answer them bc i am not sure if i am wrong
Answers: 1
image
Computers and Technology, 24.06.2019 05:50, 11232003
What all vehicles has tesla inc. created over the years
Answers: 3
image
Computers and Technology, 24.06.2019 07:30, LuckyCharms988
Consider the folloeing website url: what does the "http: //" represent? a. protocal identifier. b. ftp. c. domain name d. resource name
Answers: 2
You know the right answer?
Create an abstract class named Book. Include a String field for the book’s title and a double field...

Questions in other subjects:

Konu
Mathematics, 09.10.2019 23:30
Konu
Mathematics, 09.10.2019 23:30