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
V125BC [204]
3 years ago
7

Based on the data definition classes identified below, assume you wish to create a Dictionary class that inherits from the Book

class. In addition to title and cost, the Dictionary class must also store the number of words present in the dictionary. Write the code that will create a constructor in the dictionary class that passes in and sets the dictionary's title, cost, and number of words.
Computers and Technology
1 answer:
BabaBlast [244]3 years ago
7 0

Answer:

Explanation:

The following code is written in Java and creates the constructor for the Dictionary class as requested. This class extends the Book class and assumes that the variables for the title and the cost are part of the Book class, so it simply calls and initializes them using the constructor.

class Dictionary extends Book {

   int numberWords;

   

   public void Dictionary(String title, int cost, int numberWords) {

       this.title = title;

       this.cost = cost;

       this.numberWords = numberWords;

   }

}

You might be interested in
Through the use of ____, governments can keep an eye on criminals and monitor regions in their own countries.
Tcecarenko [31]
Through the use of <span>satellite imagery</span>
7 0
3 years ago
What is tahe difference between a cone and a prism
Natalka [10]

prism is (geometry) a polyhedron with parallel ends of the same size and shape, the other faces being parallelogram-shaped sides while cone is (label) a surface of revolution formed by rotating a segment of a line around another line that intersects the first line.

4 0
2 years ago
How to add up multiple user inputs for example: If i ask the user How many numbers do you want to add? they say 5 then i out put
Morgarella [4.7K]

Answer:

import java.util.Scanner;

class Main {

 public static void main(String[] args) {

   Scanner scanner = new Scanner(System.in);

   System.out.println("How many numbers do you want to add?");

   int numberOfNumbers = scanner.nextInt();

   int arrayNumbers[] = new int[numberOfNumbers];

   System.out.println("Enter " + numberOfNumbers + " numbers:\n");

   for(int i = 0; i < numberOfNumbers; i++){

     int addToArray = scanner.nextInt();

     arrayNumbers[i] = addToArray;

   }

   int sum = 0;

   for(int j = 0; j < arrayNumbers.length; j++){

     sum+=arrayNumbers[j];

   }

   System.out.println("Sum: " + sum);

 }

}

Explanation:

6 0
2 years ago
Which element in the PowerPoint application is not available in the Microsoft Word® application?
mihalych1998 [28]
The element found in powerpoint but not word would be the ability to create slides, or presentations My Source Is google Hope This Helps You!!!!!!
4 0
3 years ago
Read 2 more answers
The international space station (iss) will be a ____ research laboratorya) russianb) japanesec)permanentd) temporary
Sedaia [141]
The ISS is

D) permanent
4 0
3 years ago
Other questions:
  • Climate is considered a(n) _______ limiting factor. (2 points)
    9·1 answer
  • If you are feeling sick and you want to drive somewhere, you should
    12·2 answers
  • Based on your prior knowledge, match each civilization to the region it occupied.<br>​
    12·1 answer
  • What is the purpose of using a good e-mail technique?. Demonstrate your ability to write good e-mails b. Completely describe you
    8·1 answer
  • Ladders are a fundamental piece of equipment on construction sites and employers are expected to ensure that workers follow safe
    5·1 answer
  • How can i clear the CMOS​
    6·1 answer
  • What is the Microsoft excel window where you work on. And it composed of three worksheet?​
    7·1 answer
  • Follow me on Tik-Tok​
    7·2 answers
  • We have studied machine cycle in class. Suppose that each of the four modules of machine cycle is taking 2 seconds. If there are
    5·1 answer
  • click the view lab button. restart the computer and press the f2 or delete key on your keyboard to enter the bios setup program.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!