Menu

[Solved]Java Create Interface Called Amount Includes Method Called Setprice Create Abstract Class Q37300598

In Java

Create an interface called Amount that includes a method called setPricel) Create an abstract class named Book that inherits

Create an interface called

Amount

that includes a method called

setPrice

().

Create an abstract class named

Book

that inherits from the interface Amount. Include a String fieldfor

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 getter methods

— one that returns the title and one that returns the

price. Include an abstract method named

setPrice

().

Create a child class of Book:

NonFiction

. Must include a

setPrice

() method that sets the price for all

NonFiction Books to $37.99. Should also include a

constructor

.

Create a child class of Book:

Fiction

(Make the class

final

). Must include a

setPrice

() method that sets the

price for all Fiction Books to $ 24.99. Should also includea

constructor

. Also include a

ratings

field that

can be assigned to either G, PG, R, NR.

Create another child class that inherits from NonFictioncalled

Adults

. Include a

setPrice

() method that

sets the price to $50.00. Also include a field called

level

which can be assigned to painful, dull,

interesting and exciting. Also include a

constructor

Create a

Driver

class that creates an array of objects for all the classes (Onlythe ones that are possible)

and display their fields.

Thank you 🙂

Create an interface called Amount that includes a method called setPricel) Create an abstract class named Book that inherits from the interface Amount. 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 getter methods-one that returns the title and one that returns the price. Include an abstract method named setPrice() Create a child class of Book: NonFiction. Must include a setPrice() method that sets the price for all NonFiction Books to $37.99. Should also include a constructor. Create a child class of Book: Fiction (Make the class final). Must include a setPrice() method that sets the price for all Fiction Books to $ 24.99. Should also include a constructor. Also include a ratings field that can be assigned to either G, PG, R, NR. Create another child class that inherits from NonFiction called Adults. Include a setPrice() method that sets the price to $50.00. Also include a field called level which can be assigned to painful, dull, interesting and exciting. Also include a constructor Create a Driver class that creates an array of objects for all the classes (Only the ones that are possible) and display their fields. Show transcribed image text Create an interface called Amount that includes a method called setPricel) Create an abstract class named Book that inherits from the interface Amount. 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 getter methods-one that returns the title and one that returns the price. Include an abstract method named setPrice() Create a child class of Book: NonFiction. Must include a setPrice() method that sets the price for all NonFiction Books to $37.99. Should also include a constructor. Create a child class of Book: Fiction (Make the class final). Must include a setPrice() method that sets the price for all Fiction Books to $ 24.99. Should also include a constructor. Also include a ratings field that can be assigned to either G, PG, R, NR. Create another child class that inherits from NonFiction called Adults. Include a setPrice() method that sets the price to $50.00. Also include a field called level which can be assigned to painful, dull, interesting and exciting. Also include a constructor Create a Driver class that creates an array of objects for all the classes (Only the ones that are possible) and display their fields.

Expert Answer


Answer to In Java Create an interface called Amount that includes a method called setPrice (). Create an abstract class named Book… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *