Question: Can I get some help with this one? The TestBooks should ask the user the following questions using scanner and use the inputs to form
Can I get some help with this one? The TestBooks should ask the user the following questions using scanner and use the inputs to form the array(s):
"How many books would you like to enter?" (this should determine length of array)
"What is the title of the book?"
"Is the book of fiction or nonfiction?"
"Would you like to enter a price?" (if yes, prompt...if no, use default constuctor)
Would you like to add another book?" (if yes, return to "how many books..", if no, display books)


Introduction to Abstract Classes This exercise is designed to introduce you to the concept of inheritance using an abstract class You are to design three classes, a base class and two derived classes according to the specifications below I. Create an abstract class named Books Fields: title - a String field price- a float field Constructors: A default constructor A constructor with two arguments, title and price. Two getters, one for each field of the class toString0, an abstract method Methods II. Create a subclass named Fiction: Field numPages - an integer field Constructors: A constructor with two arguments, the title and the number of pages that sets the price to a default value of $27.95 A constructor with three arguments, the title, number of pages and the price. Getter methods for the class field toStringO- to display all the field values Create a subclass named NonFiction: Methods Field: topic a String field to describe the topic area of the book (e.g.: History Biography, Science, etc.) Constructors: A constructor with two arguments, the title and the topic that sets the price to a default value of $34.75 A constructor with three arguments, the title, the topic and the price. Getter methods for the class field toString0- to display all the field values Methods
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
