Question: Task 3 An online shop sells items. Each item has a price and a name. Items are either DVDs or books, for a DVD the

 Task 3 An online shop sells items. Each item has a

Task 3 An online shop sells items. Each item has a price and a name. Items are either DVDs or books, for a DVD the playing Time is given in addition, for a book the numberOfPages. Furthermore any item may be discounted by a discountPercentage between 0 (included) and 100 (excluded) Represent the situation by a suitable class structure. Each class should contain a suitable constructor and a toString method that presents the information in a suitable human readable form. Make use of inheritance where appropriate. Give suitable examples for the different possibilities of items (DVD versus book, and some items discounted versus some not) in main methods. Important: Justify your design decisions (as Java comments). [25 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!