answer.
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
Alexeev081 [22]
2 years ago
14

Insert the missing code in the following code fragment. This fragment is intended to call the Vehicle class's method. public cla

ss Vehicle { . . . public void setVehicleClass(double numberAxles) { . . . } } public class Motorcycle extends Vehicle { . . . public Motorcycle() { _______________; } }
Computers and Technology
1 answer:
gayaneshka [121]2 years ago
3 0

Answer:

The answer is D.

Explanation:

The question is incomplete, here is the full question;

Insert the missing code in the following code fragment. This fragment is intended to call the Vehicle class's method.

public class Vehicle

{

. . .

public void setVehicleClass(double numberAxles)

{

. . .

}

}

public class Motorcycle extends Vehicle

{

. . .

public Motorcycle()

{

_______________;

}

}

a) Motorcyle.setVehicleClass(2.0);

b) Vehicle.setVehicleClass(2.0);

c) this.setVehicleClass(2.0);

d) setVehicleClass(2.0);

According to the information and the code snippet given in the question, the correct answer to fill in the blank should be D,  setVehicleClass(2.0); because it is in the Motorcycle class which "extends" vehicle meaning that it's a subclass.

I hope this answer helps.

You might be interested in
Digital cellphones use __________ to reduce the size of the channels that are required by scattering the digital fragments of co
Yuri [45]

Digital cellphones use Digital Compression to reduce the size of the channels that are required, by scattering the digital fragments of conversations over many channels

7 0
2 years ago
Drag each label to the correct location on the image.
pantera1 [17]

Answer:

1.computer-based  training modules  is an example of hierarchical technique.

Explanation:

Computer based training modules are the example of hierarchical model or technique of website. In this technique courses or modules are linked with each other in hierarchical structure. To start some advance module we should learn some basic modules first.

2.school website is an example of Linear Structure of Website.

Explanation:

In linear structure of website, pages are linked in a sequence. We can follow the links to find some information in sequential manner.

3.bookstore  website is an example of Linear Structure of Website.

Explanation:

In linear structure of website, pages are linked in a sequence. We can follow the links to find some information in sequential manner.

4.single-product  websites is an example of Linear Structure of Website.

Explanation:

In linear structure of website, pages are linked in a sequence. We can follow the links to find some information in sequential manner.

5.county library  website is an example of Webbed technique.

Explanation:

Computer based training modules are the example of webbed model or technique of website. In this technique many pages are connected or linked to many other pages and each page can access any other page. This is a complex structure of website.

6.online gift store  website is an example of Linear Structure of Website.

Explanation:

In linear structure of website, pages are linked in a sequence. We can follow the links to find some information in sequential manner.

7.federal government  website is an example of Webbed technique.

Explanation:

Computer based training modules are the example of webbed model or technique of website. In this technique many pages are connected or linked to many other pages and each page can access any other page. This is a complex structure of website.

3 0
2 years ago
Write the prototype for a function named showValues. It should accept an array of integers and an integer for the array size as
aalyn [17]

Answer:

void showValues(int [<em>maximum</em><em> </em><em>volume</em>],int);

4 0
2 years ago
Read 3 more answers
Define and test a function myRange. This function should behave like Python’s standard range function, with the required and opt
Cerrena [4.2K]

Answer:

Study Python’s help on range to determine the names, positions, and what to do with your function’s parameters.

Use a default value of None for the two optional parameters. If these parameters both equal None, then the function has been called with just the stop value. If just the third parameter equals None, then the function has been called with a start value as well. Thus, the first part of the function’s code establishes what the values of the parameters are or should be. The rest of the code uses those values to build a list by counting up or down.

6 0
2 years ago
Read 2 more answers
. Write a statement that throws an IllgalArgumentException with the error message Argument cannot be negative.
dybincka [34]

Answer:

public class PostAccount

{

  public void withdraw(float savings)

  {

     if (savings >=0 )

     {

        IllegalArgumentException exception

              = new IllegalArgumentException("Savings cannot be negative");

        throw exception;

     }

     balance = savings - withdraw;

  }

 }

Explanation:

IllgalArgumentException is a type of NumberFormatException  of runtime exception. Here in the program we have created an object of IllgalArgumentException class and after that we have thrown the error to show the condition if it does not satisfy the if condition.

8 0
2 years ago
Other questions:
  • Gloria needs to show in spreadsheet form the number of students in her class who speak different languages. Which type of graph
    7·1 answer
  • You are researching RAM for a computer you are building for a friend who will be using the system as a home office server for he
    14·1 answer
  • Garrett wants to search through a csv file to find all rows that have either the name John or Bob in them and display them out t
    9·1 answer
  • Choose the attribute used to provide accessibility by configuring a text alternative that is available to browsers and other use
    14·1 answer
  • 14.28. Consider the relation R, which has attributes that hold schedules of courses and sections at a university; R = {Course_no
    7·1 answer
  • (1) Output a menu of automotive services and the corresponding cost of each service. (2 pts) Ex: Davy's auto shop services Oil c
    15·1 answer
  • Suggest how the following requirements might be rewritten in a quantitative way. You may use any metrics you like to express the
    7·1 answer
  • Write a program to read-in a sequence of integers from the keyboard using scanf(). Your program will determine (a) the largest i
    8·1 answer
  • They predicted another cold day in Seattle. They predicted another windy day in Seattle. Combine the sentences into one sentence
    8·1 answer
  • In order to avoid slipping in the shop, your footwear should ___________.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!