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
Before attempting the​ exercise, click here to watch a short video. Of the following list of tools used at Arnold Palmer​ Hospit
Nitella [24]

Answer:

A. flowcharts

Explanation:

Flowcharts are used to graphically describes a process or​ system. They can simulate the whole process step by step showing arrows between different steps.

5 0
3 years ago
A small bank with several regional branches is searching for a solution to consolidate its business services into a single site
Licemer1 [7]

Answer:

private cloud

Explanation:

Based on the scenario being described it can be said that the best method to meet the banks needs would be implementing a private cloud. This is an pool of shared computing resources in a public cloud, but one which is completely isolated from other organizations using the same provider or cloud resources. Which is exactly what the small bank needs in this situation.

4 0
3 years ago
Read 2 more answers
Knowledge and experience help you
Zarrin [17]

Answer:

yes it can it shows u what you did wrong or what you did right

Explanation:

brainlet me please

8 0
3 years ago
Special instruments can be attached to a telescope's _______________to enable astronomers to enhance by brightening or enlarging
Arte-miy333 [17]
I think it is D. eyepiece because what I know we can put a camera to the eyepiece
7 0
4 years ago
Can u please help me solve this
azamat

Alice has twice as many pencils as Cara. Leon has three more pencils than Alice. The three children have a total of 58 pencils.

<h3>What are the no. of pencils?</h3>

The no. of pencils are there totally as the 11.

Read more about the basic maths:

brainly.com/question/19493296

#SPJ1

4 0
2 years ago
Other questions:
  • What is &lt;html&gt;
    9·2 answers
  • Database designers typically do not add spaces in field names (LName), but can add details in the ________ field of the field pr
    12·1 answer
  • Intuitively, which of the following would happen to e⃗ net if d became very large?
    6·1 answer
  • Write a program to define a variable size array, ask the user to enter the size of array and its elements. Then search whether a
    6·1 answer
  • These icons cannot be removed from the Dock. Finder e-mail music player Trash
    14·1 answer
  • True or false A job analysis weight the positives and negative of a given career
    13·1 answer
  • Describe how spacecraft evolved from the US Mercury to contemporary space shuttles.
    10·1 answer
  • We _____to separate the code in sub programs from the main code<br><br> Please help!!
    10·2 answers
  • $
    15·2 answers
  • True or false we can used virus not use pirated software and programs ​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!