Question: Create an abstract class named Book. Include a String field for the books title and a double field for the books price. Within the class,

Create an abstract class named Book. Include a String field for the books title and a double field for the books price. Within the class, include a constructor that requires the book title and add two get methodsone 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

  1. create both a Fiction and a NonFiction Book, and display their fields. Save the files as Book.java, Fiction.java, NonFiction.java, and UseBook.java.
  2. Write an application named BookArray in which you create an array that holds 10 Books, some Fiction and some NonFiction. Using a for loop, display details about all 10 books. Save the file as BookArray.java.

Program requirements:

  • All the fields are to be validated and does not take invalid values.
  • Avoiding errors in data
  • Controlling amount of input.
  • The system should be able to manage the details.
  • System should provide a necessary report.

Additional requirements:

a) Design and implement the functionality to allow the operation such as design, implement, test and document.

b) All files must contain the following information: your name, student id, course, and date within comments (in the header) in the source code and the report document.

c) You would also need to submit a report detailing the development of the program. It should contain the design, source code and properly labelled sample screenshots of your program execution.

You may model your design based on the scenario given above. The quality of your system will be based on how much detail your system design as well as the level of completeness of your design and the actual system.

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!