In this exercise, you are going to be working with 4 classes, a Book Superclass with...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In this exercise, you are going to be working with 4 classes, a Book Superclass with TextBook and Novel subclasses, and a BookTester class to run your program. For the Book, TextBook, and Novel class, you will create a constructor and all getters and setters. Be sure to follow standard naming conventions for your getters and setters! Additional information for each class is below. Book Class The Book class will have a title and author as instance variables and the constructor should follow this format: public Book(String title, String author) TextBook Class The TextBook class will have a subject and edition as instance variables and the constructor should follow this format: public TextBook (String title, String author, String subject, String edition) Novel Class The Novel class will have a genre and pages as instance variables and the constructor should follow this format: public Novel(String title, String author, String genre, int pages) BookTester In the tester class, you should create an ArrayList that will store all the books in your library. Then create your library by adding at least 3 textbooks and 3 novels to the ArrayList. After creating your library, use a loop to access the ArrayList and print out any information you have access to. Errors: Test Pass Message 1. BookTester.java: Line 10: incompatible types: int cannot be converted to String 2. BookTester.java: Line 12: incompatible types: int cannot be converted to String 3. BookTester.java: Line 14: incompatible types: int cannot be converted to String 4. BookTester.java: Line 16: incompatible types: int cannot be converted to String 5. BookTester.java: Line 18: incompatible types: int cannot be converted to String 6. BookTester.java: Line 20: incompatible types: int cannot be converted to String In this exercise, you are going to be working with 4 classes, a Book Superclass with TextBook and Novel subclasses, and a BookTester class to run your program. For the Book, TextBook, and Novel class, you will create a constructor and all getters and setters. Be sure to follow standard naming conventions for your getters and setters! Additional information for each class is below. Book Class The Book class will have a title and author as instance variables and the constructor should follow this format: public Book(String title, String author) TextBook Class The TextBook class will have a subject and edition as instance variables and the constructor should follow this format: public TextBook (String title, String author, String subject, String edition) Novel Class The Novel class will have a genre and pages as instance variables and the constructor should follow this format: public Novel(String title, String author, String genre, int pages) BookTester In the tester class, you should create an ArrayList that will store all the books in your library. Then create your library by adding at least 3 textbooks and 3 novels to the ArrayList. After creating your library, use a loop to access the ArrayList and print out any information you have access to. Errors: Test Pass Message 1. BookTester.java: Line 10: incompatible types: int cannot be converted to String 2. BookTester.java: Line 12: incompatible types: int cannot be converted to String 3. BookTester.java: Line 14: incompatible types: int cannot be converted to String 4. BookTester.java: Line 16: incompatible types: int cannot be converted to String 5. BookTester.java: Line 18: incompatible types: int cannot be converted to String 6. BookTester.java: Line 20: incompatible types: int cannot be converted to String
Expert Answer:
Answer rating: 100% (QA)
According to the instruction java import javautilArrayList class Book private String title private String author ... View the full answer
Related Book For
Introduction to Data Mining
ISBN: 978-0321321367
1st edition
Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar
Posted Date:
Students also viewed these programming questions
-
Predictive text entry systems are familiar on touch screens and mobile phones. This question asks you to consider how the same principles might be used in a programming editor for creating Java code....
-
Please help me with this Java Assignment. Solving the game of Boggle can be done elegantly with recursion and backtracking. Backtracking is a technique whereby an algorithm recognizes it is...
-
1. What is differences between the ancient Mayan criminal justice system and modern criminal justice systems? 2. Does the legal system of the ancient Maya has any relevance to the modern world? File...
-
On May 1, 2011, MEM Corp. issued $800,000 of five-year, 6% bonds at 100. The bonds pay interest semi-annually on November 1 and May 1. MEM's year end is December 31 and it makes adjusting entries...
-
In Exercises 1726, evaluate the iterated integral by converting to polar coordinates. 10 Jy /8- x + y dx dy
-
What are some indicators that a digital device has been infected?
-
Income statement and schedule of cost of goods manufactured. The Howell Corporation has the following account balances (in millions): Prepare an income statement and a supporting schedule of cost of...
-
Consider the following ridiculously simple linear system: 10 (9)(2)-(0) a. What is the solution of this linear system? You don't have to show your work. b. Set up a Neumann iteration with initial...
-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 A Ready B Journal entry: Calculate the taxable income/tax loss and the current tax...
-
what ways does ethnocentrism intersect with broader concepts such as nationalism and cultural imperialism?
-
Jason and Amanda have accumulated significant personal assets over the last twenty years, and are now considering the implications of these assets on their estate planning as they have come to...
-
Consider a company subject to a corporate tax rate of 0.3. If the company has a debt ratio of 0.3, and an unleveraged beta of 0.9, what is the company's leveraged beta?
-
What is the significance of an accelerated method? Why do companies not use straight - line for both financial?
-
Use the following data to calculate the cost of ending inventory using the l I f o method. September 1 st beginning inventory 1 5 units at $ 2 0 Each. September 1 0 th purchase 2 0 units at $ 2 5...
-
Imagine that a hypothetical life form is discovered on our moon and transported to Earth. On a hot day, this life form begins to sweat, and it is determined that the heat of vaporization of its sweat...
-
Determine the reactions in supports A and D and connections B and C. Sketch its shear and moment diagram and determine the magnitude ankoration of the maximum shear and moment for every member. 18 3...
-
Following is a data set that contains two attributes, X and Y, and two class labels, "+" and "". Each attribute can take three different values: 0, 1, or 2. The concept for the "+" class is Y = 1 and...
-
Many sciences rely on observation instead of (or in addition to) designed experiments. Compare the data quality issues involved in observational science with those of experimental science and data...
-
Consider the task of building a classifier from random data, where the attribute values are generated randomly irrespective of the class labels. Assume the data set contains records from two classes,...
-
Parents with a child in subsidized childcare in the province of Qubec, Canada, pay a basic amount and, depending on family income, may pay an additional amount. As of January 1, 2017, families with a...
-
A firm in the state of Karnataka in India can source one of its factors of production either within the state, \(F_{K}\), or from the neighboring state of Maharashtra, \(F_{M}\). Assume the quality...
-
A firm has the cost curve \(C(q)=25+q^{2}\). Show how the firm's average cost varies with output. Is there a minimum average cost and, if so, at what level of output is average cost minimized?
Study smarter with the SolutionInn App