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 & Unwin
21 September 1937
The Illustrated Encyclopedia of the Universe
James W. Guthrie Watson-Guptill
2001
2nd
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

Answers

Answer 1

The program relating to the encylopedia is illustrated below:

public class Encyclopedia extends Book {

  String edition;

  int numVolumes;

  public String getEdition() {

      return edition;

  }

  public void setEdition(String edition) {

      this.edition = edition;

  }

  print 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());

  }

How to illustrate the information?

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.

In this case, the encylopedia was illustrated above.

Learn more about program on:

https://brainly.com/question/26642771

#SPJ1


Related Questions

Identify the symbol. please help!!

Answers

Explanation:

counter bore

Answer:

Diameter

Explanation:

On technical literature or drawings, it could be a symbol to mean diameter.

A time-dependent action is placed in the workflow queue when the record is created. When will the action be removed from the queue? Choose 2 answers.

Answers

Complete Question:

A time-dependent action is placed in the workflow queue when the record is created. When will the action be removed from the queue? Choose 2 answers.

Group of answer choices.

A. When another record triggers the same workflow rule

B. When the action is deleted from the workflow queue.

C. When a validation rule is triggered for the record

D. When the record no longer matches the rule criteria.

Answer:

B. When the action is deleted from the workflow queue.

D. When the record no longer matches the rule criteria.

Explanation:

Workflow management systems can be defined as a strategic software application or program designed to avail companies the infrastructure to setup, define, create and manage the performance or execution of series of sequential tasks, as well as respond to workflow participants.

Some examples of workflow management systems used around the world are YAWL, Windows Workflow Foundation, Apache ODE, Collective Knowledge, Workflow Gen, PRPC, Salesforce.com, jBPM, Bonita BPM etc.

Time-dependent actions are actions that are executed at a specific period of time before the close-date of a database record.

Generally, a time-dependent action is placed in the workflow queue when the record is created. Therefore, the action will be removed from the queue under the these two (2) conditions;

I. When the action is deleted from the workflow queue.

II. When the record no longer matches he rule criteria.

There's a chupacabra that looks like a mixed alligator , gecko it looks' like that but if you try harming it will it eat you "look up chupacabra only don't try looking up if it eats meat because that thing is a legendary animal and barely haves answers and has been cured alot and lives in the folklore mostly like the woods" it looks scary and cool the same time but some people said it has been instinct but it isn't it is spanish "which is puerto rican" lives in the united states, and mexico.. ( does it eat meat ) hasn't been seen around but you'll see a picture of it..

Answers

Answer:

wait. is this even a question or is it just informing us?

Explanation:

either way it is cool

What princple of animation is used to animate the movements of the arms of the following character while walking?

Answers

Answer:

arc

Explanation:

Question #1
Dropdown
What is the value of the totalCost at the end of this program?
quantity = 5
cost = 3
totalCost = quantity * cost
totalCost is
15
3
8

Answers

Answer:

the answer is 25

Explanation:

because ot is 25 due to the GB

The total cost when given cost as 3 and quantity as 5 is; 15

We are given;

Quantity = 5

Cost = 3

Now we are told that formula for the total cost is;

Total Cost = quantity × cost

Plugging in the given values of quantity and cost gives us;

Total Cost = 5 × 3

Total cost = 15

In conclusion, the total cost from the values of quantity and individual cost we are given is 15

Read more about total cost at;https://brainly.com/question/2021001

ANSWER ASAP PLEASE Question #4
Fill in the Blank
Fill in the blank to complete the sentence.
_____ is used to store and process data over the Internet using computers that are not located at tthe users site.

Answers

Answer:

A cookie.

Explanation:

Click the crown at the top of this answer if this helped ;)

You wrote a program to allow the user to guess a number. Complete the code to get a number from the user.

# Get a guess from the user and update the number of guesses.

guess =

("Guess an integer from 1 to 10: ")

NEED HELP FAST

Answers

Answer:

import random

number = random.randrange(1, 10)

is_guess = 'y'

while is_guess == 'y':

   try:

       guess = int(input("Guess an integer number between 1 and 10: "))

       if guess < 1 or guess >10:

           print("You have exceeded the guessing range, try again")

           continue

       elif guess == number:

           print("Congrats! You guessed right.")

       else:

           print("Sorry, you guessed wrong")

   except ValueError:

       print("Your guess must be an integer number.")

   is_guess = input("Do you want to try again y/n ? ")

Explanation:

The random module of the python programming language is used to randomly select an integer value from a range of numbers. The guess variable value is a user input of an integer number.

If the guess variable is equal to the random number, then the program prints a congratulatory message. The program is no constant loop so long as the is_guess variable is equal to 'y'.

The try-except statement is used to detect the value error of the guess variable.

Answer:

input

Explanation:

click it to paste the content of clipboard ​

Answers

Ctrl + V

It is used for paste function.

. Write a short Python function that takes a sequence of integer values and determines if there is a distinct pair of numbers in the sequence whose product is odd. (1 Point)

Answers

Answer:

Explanation:

The following code is written in Python and like requested takes a function called odd_number that takes a list of integers as a parameter. It then loops through the list two times, each time calculating the product of the two numbers and returning Yes if the product is an odd number while also including the two numbers from the list that make that product. If there is no odd product in the list the function simply returns No

def odd_product(my_list):

   for num1 in range(len(my_list)):

       for num2 in range(len(my_list)):

           if num1 == num2:

               pass

           else:

               product = my_list.__getitem__(num1) * my_list.__getitem__(num2)

               if (product % 2) != 0:

                   return "Yes, " + str(my_list.__getitem__(num1)) + " and " + str(my_list.__getitem__(num2))

   return "No"

Which HTML tag is used to add an ordered list to a web page?

Answers

Answer:

<ol> Defines an ordered list

Answer:

<ol>

Explanation:

List the do's and don'ts of secure online interactions

Answers

Answer:

The answer is below

Explanation:

The "dos" are the safe practice's website users should always do to provide themselves a form of security against potential hackers in online interactions.

Hence, are the "dos" based on the options listed.

1. Use a long password with mixed characters

2. Use antivirus and spyware protection

3. Don't write your password down and leave it where others can find it

4. Go through the terms and conditions, and privacy policies of social networking and other websites that you access.

On the other hand, the "don'ts" are the practices a website user or visitor should avoid doing to provide themselves a form of security against potential hackers in online interactions.

Hence, are the "don'ts" based on the options listed.

1. Keep yourself logged in when you leave your computer

2. Share your password with your friends

3. Retain cookies every time you visit a website.

Please program this in Python.


Create a list of your favorite 4 movies. Print out the 0th element in the list. Now set the 0th element to be “Star Wars” and try printing it out again.

Answers

lst = ["Star Wars", "Movie 2", "Movie 3", "Movie 4"]

print(lst[0])

I wrote my code in python 3.8. Best of luck

Another technique that makes use of the colon slicing technique to directly refer to element places is list slicing. Use a blank value before the first colon to access the first element, then use len() with -1 as the input to access the last element.

What is the 0th element in the list?

The element of the current ArrayList object at the provided index is returned by the get() function of the ArrayList class, which accepts an integer indicating the index value.

As a result, if you supply 0 or list to this method, you can obtain the first element of the current ArrayList.

Use a for loop with range (0, N) to get the first N members of a list. Then, make a new empty list and append the elements of the source list to the new list within the for loop. Range(0, N) iterates in steps of 1 from 0 to N-1. N is not comprised.

Therefore,lst = ["Star Wars", "Movie 2", "Movie 3", "Movie 4"] print(lst[0]).

Learn more about element here:

https://brainly.com/question/19312961

#SPJ2

When a digital camera produces an image by exposing an electronic sensor to light, the process involves a lens and a ____
that opens for a certain period of time.

Answers

Answer:

Shutter

Explanation:

What is a free and compatible alternative to the Microsoft Office Suite (word processing, spreadsheets, and calendars)?

WordPad
Open Office
Notepad
Lotus Notes

Answers

Answer:

Open Office

Explanation:

Open Office may be regarded as an open source productivity tool which allows users to enjoy the ability to create and edit documents similar to Microsoft Word, create spreadsheet files and documents similar to Microsoft excel and Presentation tool similar to Microsoft PowerPoint. With the open source category of open office, it means it is a free software whereby users can enjoy these tools without having to purchase any user license. The other tools in the option such as Notepad, Lotus note do not posses all these functionality.

You respond to a fire at a pharmaceutical production plant. One of the outside storage tanks is on fire. The placard on the tank shows the ID number is 1053. What is this material?

Answers

Answer:

Hydrogen sulfide.

Explanation:

Hydrogen sulfide is a chemical compound formed due to the reaction of hydrogen and sulfur. It is a colorless, corrosive, poisonous and highly flammable gas having the foul smell of rotten eggs.

Under the United Nations/North America number datasheet, the identification number for hydrogen sulfide is 1053.

In this scenario, you respond to a fire at a pharmaceutical production plant. One of the outside storage tanks is on fire. The placard on the tank shows the ID number is 1053. Therefore, this material is hydrogen sulfide.

Sarah is a detail-oriented programmer. While testing her program, what other skill would she have to apply in order to detect all bugs?
A.
troubleshooting
B.
business skills
C.
managerial skills
D.
concentration
E.
time management

Answers

Answer:

A. troubleshooting

Explanation:

Troubleshooting is the process of trying to detect problems with a software or hardware component so as to apply solutions to it.

Therefore, Sarah would need troubleshooting skills to help her test her program to detect all bugs and fix it.

For this exercise, we are going to take a look at an alternate Calculator class, but this one is broken. There are several scope issues in the calculator class that are preventing it from running. Your task is to fix the Calculator class so that it runs and prints out the correct results. The CalculatorTester is completed and should function correctly once you fix the Calculator class.
public class Calculator {
private int total;
private int value;
public Calculator(int startingValue){
int total = startingValue;
value = 0;
}
public int add(int value){
int total = total + value;
return total;
}
/**
* Adds the instance variable value to the total
*/
public int add(){
int total += value;
return total;
}
public int multiple(int value){
int total *= value;
return total;
}
public void setValue(int value){
value = value;
}
public int getValue(){
return value;
}
}

Answers

Answer:

public class Calculator {

   private int total;

   private int value;

   

   public Calculator(int startingValue){

       // no need to create a new total variable here, we need to set to the our instance total variable

       total = startingValue;

       value = 0;

   }

   public int add(int value){

       //same here, no need to create a new total variable. We need to add the value to the instance total variable

       total = total + value;

       return total;

   }

   /**

   * Adds the instance variable value to the total

   */

   public int add(){

       // no need to create a new total variable. We need to add the value to the instance total variable

       total += value;

       return total;

   }

   public int multiple(int value){

       // no need to create a new total variable. We need to multiply the instance total variable by value.

       total *= value;

       return total;

   }

   //We need to specify which value refers to which variable. Otherwise, there will be confusion. Since you declare the parameter as value, you need to put this keyword before the instance variable so that it will be distinguishable by the compiler.

   public void setValue(int value){

       this.value = value;

   }

   public int getValue(){

       return value;

   }

}

Explanation:

I fixed the errors. You may see them as comments in the code

explain why it is important for you to understand and describe the basic internal and external components of a computer in the work place​

Answers

Answer:

you go to edit

Explanation:

Write a Python function that takes a positive integer N and returns the factorial of N, i.e., N! The factorial of N, denoted N!, is the product of the integers from 1 to N. (1 Point)

Answers

Answer:

The python function is as follows:

def fact(N):

   factorial = 1

   for i in range(1,N+1):

       factorial = factorial * i

   return(factorial)

Explanation:

This line defines the function

def fact(N):

This line initializes the product of 1 to N to 1

   factorial = 1

This line iterates through 1 to N

   for i in range(1,N+1):

This line calculates the product of 1 to N i.e. factorial

       factorial = factorial * i

This line returns the factorial

   return(factorial)

Can someone please help me with 6.8 Code Practice adhesive.

Answers

Answer:

I'm looking for this one too

Answer:

import simplegui

import random

# global constants

WIDTH = 600

HEIGHT = 400

PARTICLE_RADIUS = 5

COLOR_LIST = ["Red", "Green", "Blue", "White"]

DIRECTION_LIST = [[1,0], [0, 1], [-1, 0], [0, -1]]

# definition of Particle class

class Particle:

  # initializer for particles

  def __init__(self, position, color):

      self.position = position

      self.color = color

  # method that updates position of a particle    

  def move(self, offset):

      self.position[0] += offset[0]

      self.position[1] += offset[1]

  # draw method for particles

  def draw(self, canvas):

      canvas.draw_circle(self.position, PARTICLE_RADIUS, 1, self.color, self.color)

  # string method for particles

  def __str__(self):

      return "Particle with position = " + str(self.position) + " and color = " + self.color

# draw handler

def draw(canvas):

  for p in particle_list:

      p.move(random.choice(DIRECTION_LIST))

  for p in particle_list:

      p.draw(canvas)

# create frame and register draw handler

frame = simplegui.create_frame("Particle simulator", WIDTH, HEIGHT)

frame.set_draw_handler(draw)

# create a list of particles

particle_list = []

for i in range(100):

  p = Particle([WIDTH / 2, HEIGHT / 2], random.choice(COLOR_LIST))

  particle_list.append(p)

# start frame

frame.start()

Explanation:

this worked for me, sorry if its to late. let me know if anything is wrong

Fix the code so that the list of elements that end with "e".
// //Q2: Create a list of elements that end with the letter "e"
// //Hint: The last index item is always length-1
var nameElementE = [];
for (var i = 0; i < nameElement.length; i++) {
if (nameElement[i].substring(0,1)=="E"){
appendItem(nameElementE, nameElement[i]);
}
}
console.log(nameElementE);

// //Console.log out your final list

Answers

Answer:

It's

B

Explanation:

Analytical Engine was designed in​

Answers

Answer:

1838

Explanation:

Analytical Engine was designed in 1838. The designer is Charles Babbage, who was an English mathematician and widely known for his innovation in the engineering world. He is often considered to be the father of computers.

Following his inability to finish the creation of Difference Engine, Charles Babbage would later when ahead to conceived the Analytical Machine in 1834

He eventually finished the design of an Analytical Machine by 1838.

Answer:

Charles Babbage

Explanation:

Just did test

3n - 12 = 5n - 2
how many solutions?

Answers

N=-5 sry about the other guy stealing


Some commands listed in a menu cannot be selected.


True or False

Answers

True! Have a nice week

Answer:

Explanation:

it is true

Other Questions
What is the genre of the movie referred to by the poster?OAel cine de accinB.el cine romnticoel cine de fantasiaD.el cine de suspenso Please Answer!Which expression is equivalent to the given expression?4(a3)= 8a 4a12 4a3 4(a+3) And this excerpt, Queen Elizabeth says " for the weak, good and safety whereof, I will never shun to spend my life in order A sculptor has just finished creating a large wooden sphere for a sculpture he is working on. The sphere has a radius of 4.3 feet and weighs approximately 10,578.59 pounds. What is the approximate density of the wood used to create the sphere? I need help What tropism does this experiment represent?The straw scrunched up and expanding represents is a representation ofCorrect answer:turgor pressure. HELPPPP PLEASE:,( Which of the following is true about American popular culture?A. It influences people in other countries.B. It is a function of an elected government.C. It is very difficult to copy.D. It only happens in large cities. this is a force which receives all motion Todos los das, Pedro toma el (1) 1 of 8 para ir a clase muy temprano. Para llegar a su (2) 2 of 8, Pedro tiene que cruzar toda la (3) 3 of 8. A Pedro esto no le importa porque a l le encanta (4) 4 of 8 las calles. En su ruta l tiene que cruzar el (5) 5 of 8 sobre el ro que pasa por delante de su casa. Casi todos los das alguien le pregunta el (6) 6 of 8 para llegar al museo que est cerca de su universidad. Pedro no entiende cmo alguien puede (7) 7 of 8, hay un letrero enorme que indica cmo llegar! Solamente hay que caminar dos cuadras, (8) 8 of 8 a la izquierda, cruzar la calle y ya ests en el museo. Facilsimo!words to choose from are camino,ciudad,cruzar,doblar,estacionamiento,estar perdido,metro,motocicleta,parada,parar,puente,recorrer Is thought a main part of characterization Find the slope and y-intercept 15 POINTS5 y = 3x helpp pls .. Which statement is true about the process shown? According to the document, what are TWO important duties of Congress? Why was the hue and cry a good policing system in the medieval period? Which strategies can writers use to support an idea in the body paragraphs? (Choose all that apply):a. specific examplesb. general statementsc. descriptionsd. analogiese. quotes from sourcesf. abstract ideas How many 2/7 s are in 3? My videos keep freezing on Brainly? define sterilisation Question 8 (1 point)Use coefficients to balance the following reaction:H2CO3 + Fe Fe2(CO3)3 + H2Blank 1:Blank 2:Blank 3:Blank 4: Probably the first thoroughly modernmusical was ...White ChristmasZiegfeld FolliesThoroughly Modern MillieShow Boat Eduardo ___________ a cocinar la cena.A. vamosB. vaC. vanD. vas