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
kenny6666 [7]
4 years ago
10

Given main() and a base Book class, define a derived class called Encyclopedia. Within the derived Encyclopedia class, define a

printInfo() method 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

Computers and Technology
1 answer:
NemiM [27]4 years ago
7 0

Answer:    

Here is the Encyclopedia class:

public class Encyclopedia extends Book {   //class  Encyclopedia that inherits from class Book

  private String edition; //declare private member variable edition of type String  

  private int numVolumes;      //declare private member variable numVolumes of type int

  public void setEdition(String ed) {  //mutator method of class that sets the value of edition

     edition = ed;    }     //assigns the value of ed to edition member field

  public void setNumVolumes(int numVol) { //mutator method of class that sets the value of numVol

     numVolumes = numVol;    }  //assigns the value of numVolumes to edition member field

  public String getEdition() {  //accessor method to get the value of edition

     return edition;    }     //returns the current value of edition

  public int getNumVolumes() {  //accessor method to get the value of numVolumes

     return numVolumes;    }       //returns the current value of numVolumes

  public void printInfo() {  //method to print edition and number of volumes information on output screen

     super.printInfo();  // The super keyword refers to parent class Book objects. It is used to call Book method and to eliminate the confusion between Book class printInfo method and Encyclopedia printInfo  method

     System.out.println("   Edition: " + edition);  //prints edition info

     System.out.println("   Number of Volumes: " + numVolumes);    }  }  //prints number of volumes info

Explanation:

The explanation is provided in the attached document.

You might be interested in
The query [windows], English (US) has two dominant interpretations: the operating system and the windows in a home.
Flauer [41]

Answer:

B. False

Explanation:

Microsoft Windows is a graphics user interface operating system that uses windows query to search for information in its directory. There are different versions and updates of the windows OS, with latest being window 10 1903. The different version of the windows 10 OS is windows professional, Home, Enterprise etc. As time goes on, more updates will be released for better and advanced security.

3 0
4 years ago
Consider the following relation for published books: BOOK (Book_title, Authorname, Book_type, Listprice, Author_affil, Publisher
Ivenika [448]

The key for this relation is Book_title,Authorname. This relation is in 1NF and not in 2NF as no attributes are FFD on the key. It is also not in 3NF

<u>Explanation:</u>

<u> lGiven the relation </u>

<u>l</u>Book(Book_title, Authorname, Book_type, Listprice, Author_affil, Publisher)

land the FDs

lBook_title . Publisher, Book_type

lBook_type . Listprice

lAuthorname .Author_affil

(a) The key for this relation is Book_title,Authorname. This relation is in 1NF and not in 2NF as no attributes are FFD on the key. It is also not in 3NF

(b) 2NF decomposition:

lBook0(Book_title, Authorname)

lBook1(Book_title, Publisher, Book_type, Listprice)

lBook2(Authorname, Author_affil)

<u> This decomposition eliminates the partial dependencies. </u>

3NF decomposition:

lBook0(Book_title, Authorname)

lBook1-1(Book_title, Publisher, Book_type)

lBook1-2(Book_type, Listprice)

lBook2(Authorname, Author_affil)

l<u>This decomposition eliminates the transitive dependency of Listprice </u>

8 0
3 years ago
What is a main benefit of using Search Audience solutions?a. They identify ad extension opportunities to improve average click-t
uranmaximum [27]

Answer:

Option C is correct.

Explanation:

The biggest advantage of utilizing Search Audience solutions is that they will ultimately deliver the best response to the best client for the appropriate offer. Effective Google Advertising projects continually focus on customer feedback to meet the best possible users through the appropriate advertisement at the appropriate moment.

So, the following are the reason that describes the other options are not appropriate according to the scenario.

6 0
3 years ago
How do i lear how to become a tv repair man?
Setler79 [48]
You should check out courses in areas like Computer Science and Technology Repair. You'll most likely find what you need with a quick and simple Google search. Good luck with your career!
7 0
4 years ago
You should NOT limit the number of words on each screen. *<br> a.true<br> b.false
Crazy boy [7]

Answer:

false

Explanation:

pls follow me on the brainly and Mark my answer in brainlist

5 0
3 years ago
Other questions:
  • Which of the following is needed if a computer with the IP address 172.31.210.10/24 wants to communicate with a computer with th
    5·1 answer
  • Skinner designed a soundproof apparatus, often equipped with a lever or bar, with which he conducted his experiments in operant
    9·1 answer
  • Key Categories: more libraries and thousands of functions
    7·1 answer
  • What type of multimedia is a game CD? Game CDs are examples of ___ multimedia.
    15·2 answers
  • _______________ is the term for the convergence of real-time and non-real-time communications services such as telephony, instan
    11·1 answer
  • In a geographic file arranged by state and then city, you would file a letter from a company that does not have an individual or
    6·1 answer
  • You are planning trip to South America and and are worried about your devices with private keys being stolen. So you decide to s
    9·1 answer
  • When in global configuration mode, which steps are necessary to edit an ip address on an Ethernet interface?
    11·1 answer
  • While an image is still being editing, it is best to save it as a PDF. Group of answer choices True False
    5·2 answers
  • 5.9.5 Fibonacci <br><br> Y’all I’m struggling here do any of you have the code?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!