1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lukranit [14]
3 years ago
12

Book information (overriding member methods) Given main() and a base Book class, define a derived class called Encyclopedia. Wit

hin the derived Encyclopedia class, define a printlnfomethod that overrides the Book class printinfo() method by printing not only the title, author, publisher, and publication date, but also the edition and number of volumes. Ex. If the input is The Hobbit J. R. R. Tolkien George Allen & Unwin 21 September 1937 The Illustrated Encyclopedia of the Universe James W. Guthrie Watson-Guptill 2001 2nd 1 the output is: Book Information: Book Title: The Hobbit Author: J. R. R. Tolkien Publisher: George Allen & Unwin Publication Date: 21 September 1937 Book Information: Book Title: The Illustrated Encyclopedia of the Universe Author: James W. Guthrie Publisher: Watson-Guptill Publication Date: 2001 Edition: 2nd Number of Volumes: 1 Note: Indentations use 3 spaces 261744 1399928 LAB ACTIVITY 11.17.1: LAB: Book information (overriding member methods) 0/10 File is marked as read only Current file: BookInformation.java 1 import java.util.Scanner; 3 public class BookInformation 2
Computers and Technology
1 answer:
IgorC [24]3 years ago
8 0

Answer:

Explanation:

The Book class and BookInformation class was not provided but was found online. After analyzing both of these classes I have created the following code that grabs and overrides the printInfo() method in order to add and print the edition and number of volumes as well

public class Encyclopedia extends Book {

   String edition;

   int numVolumes;

   public String getEdition() {

       return edition;

   }

   public void setEdition(String edition) {

       this.edition = edition;

   }

   public int getNumVolumes() {

       return numVolumes;

   }

   public void setNumVolumes(int numVolumes) {

       this.numVolumes = numVolumes;

   }

   public void printInfo() {

       System.out.println("Book Information: ");

       System.out.println(" Book Title: " + super.title);

       System.out.println(" Author: " + author);

       System.out.println(" Publisher: " + publisher);

       System.out.println(" Publication Date: " + publicationDate);

       System.out.println(" Edition: " + getEdition());

       System.out.println(" Number of Volumes: " + getNumVolumes());

   }

}

You might be interested in
What can be said about the equipment used by photographers during the Civil War?
lilavasa [31]
The answer is 1 and 4
6 0
3 years ago
Read 2 more answers
What is another name for “low-angle lighting”?
Sliva [168]
Another name for low-angle lighting is under-lighting.
4 0
3 years ago
What is this tool called?
kondor19780726 [428]
Is there a picture????????
4 0
3 years ago
Read 2 more answers
Jenny wants to create an animated short video to add to her website. Which software will she use to create this animated video?
denis23 [38]
Adobe Spark or Adobe Premier.
6 0
3 years ago
To turn off the AutoCorrect features, navigate to the AutoCorrect menu and deselect the box labeled_____.
barxatty [35]
Option A-Show AutoCorrect buttons, then you have the options to hide the autocorrect or to turn it on/off
4 0
3 years ago
Read 2 more answers
Other questions:
  • What is a benefit of peer-to-peer networking?
    14·2 answers
  • A technician mistakenly uninstalled an application that is crucial for the productivity of the user.
    6·1 answer
  • How can you tell that you're driving in the right direction?
    14·1 answer
  • Unlike memory, this type of storage holds data and programs even after electrical power to the computer system has been turned o
    10·1 answer
  • What is one of the most helpful things about having a role model?
    10·2 answers
  • how write a program to prompt the user for hours and rate per hour using input to computer gross pay Use 35 hours and rate2.75 p
    9·1 answer
  • Proxy download for school
    15·2 answers
  • The best way to ensure the accuracy and safety of your accounts is to:
    10·1 answer
  • Which of these is NOT a mathematical operator used in Python?
    12·1 answer
  • What does a theme contain?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!