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]
2 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]2 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
In “Plugged In,” the author’s purpose is to persuade. Which of the following quotes from the text shows that the author’s purpos
lisabon 2012 [21]

The quote from the text that shows that the author’s purpose is to persuade is D. Critics say that kids stare at computers and TVs all day and do not get enough exercise. The facts stand in counterpoint to this belief.

An argumentative writing prompt is written in order to convince the readers about a particular issue.

According to the author, the fact that children are involved in watching movies, playing games, listening to music, etc doesn't mean that they can't still be productive.

There are some critics that believe that kids stare at computers and TVs all day and do not get enough exercise. This was countered by the author who stated that kids can still engage in exercises or do other productive things.

Read related link on:

brainly.com/question/24861556

3 0
2 years ago
What do you observe on the filter paper strip after 2 to 3 hours?
just olya [345]
Is there pictures or anything esle to read in order to figure out the answer

5 0
2 years ago
Read 2 more answers
You are given a list of n positive integers a1, a2, . . . an and a positive integer t. Use dynamic programming to design an algo
Anna11 [10]

Answer:

See explaination for the program code

Explanation:

The code below

Pseudo-code:

//each item ai is used at most once

isSubsetSum(A[],n,t)//takes array of items of size n, and sum t

{

boolean subset[n+1][t+1];//creating a boolean mtraix

for i=1 to n+1

subset[i][1] = true; //initially setting all first column values as true

for i = 2 to t+1

subset[1][i] = false; //initialy setting all first row values as false

for i=2 to n

{

for j=2 to t

{

if(j<A[i-1])

subset[i][j] = subset[i-1][j];

if (j >= A[i-1])

subset[i][j] = subset[i-1][j] ||

subset[i - 1][j-set[i-1]];

}

}

//returns true if there is a subset with given sum t

//other wise returns false

return subset[n][t];

}

Recurrence relation:

T(n) =T(n-1)+ t//here t is runtime of inner loop, and innner loop will run n times

T(1)=1

solving recurrence:

T(n)=T(n-1)+t

T(n)=T(n-2)+t+t

T(n)=T(n-2)+2t

T(n)=T(n-3)+3t

,,

,

T(n)=T(n-n-1)+(n-1)t

T(n)=T(1)+(n-1)t

T(n)=1+(n-1)t = O(nt)

//so complexity is :O(nt)//where n is number of element, t is given sum

6 0
2 years ago
"Your supervisor has asked you to modify the AMOUNT column in the ORDERS table. He wants the column to be configured to accept a
vesna_86 [32]

Answer:

ALTER TABLE orders

MODIFY (amount DEFAULT 250)

Explanation:

  • ALTER TABLE statement is used to modify "amount" column in the existing "orders" table  
  • MODIFY (amount DEFAULT 250) is used to set the default value 250 of the "amount" column.

Therefore if the supervisor wants the amount column to be configured to accept a default value of 250, then "ALTER TABLE orders MODIFY (amount DEFAULT 250) " statement should be issued.

5 0
3 years ago
how can a user open a blank presentation? 1.on the file menu, click new, and then click recent templates 2.on the file menu, cli
4vir4ik [10]

2.  on the file menu, click new, and then click blank presentation.

5 0
3 years ago
Other questions:
  • Which social networking function came first?
    9·2 answers
  • Pointsyour company environment includes windows server versions 2003, 2008, and 2012. desktops range from windows xp and vista.
    13·1 answer
  • The function below takes a single parameter number_list which is a list that can contain integers and floats. Complete the funct
    9·1 answer
  • 1. What is the main factor that affects Earth’s average temperature?
    12·1 answer
  • How can you achieve an effect like that shown in the image?
    7·2 answers
  • What are some of the issues that organizations need to be aware of when designing and managing data?
    8·1 answer
  • Geobubble Chart (2D) displaying Robot Density Per 10,000 Employees for the specified countries;
    7·1 answer
  • Please help me with opinions, ideas, any websites that would help, or chart, article, video, or podcast to help support your pos
    10·1 answer
  • Functions of barriers include (mark all that apply): A. Define boundaries B. Design layout C. Deny access D. Delay access
    10·1 answer
  • Which of these can be a problem for people with accessibility issues? Select 4 options.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!