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]
1 year 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]1 year 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
Ajay wants to read a brief overview about early settlers in the United States. Which type of online text source should he most l
Tanzania [10]
Well, integrity is a must if you are reading anything. So it would be any website that has either a .edu or a .gov at the end of a URL. 

I never suggest Wikipedia for brief, since 100's of people will edit one topic at a time, the answer to what he is looking for is buried in 18 pages about one settler in the United States!
5 0
1 year ago
Read 2 more answers
You are given two int variables j and k, an int array zipcodeList that has been declared and initialized, an int variable nZips
dmitriy555 [2]

Answer:

The c++ program for the scenario is given below.

#include <iostream>

using namespace std;

int main() {    

   int i,j, nZips, zipcodeList[nZips];

   bool duplicates;        

   cout<<"This program checks if duplicate values exist in the array." <<endl;    

   cout<<"Enter the number of integers to be inserted in the array."<<endl;

   cin>>nZips;    

   cout<<"Enter the integers to be inserted in the array."<<endl;    

   for(i=0; i<nZips; i++)

   {

       cin>>zipcodeList[i];

   }    

   for(i=0; i<nZips; i++)

   {

       for(j=0; j<nZips; j++)

       {

           if(i != j)

           {

               if(zipcodeList[i] == zipcodeList[j])

               {

                   duplicates = true;

                   cout<<"The value of duplicates variable is true meaning "<<duplicates<<endl;

                   break;

               }

               else

                   duplicates = false;

           }

       }

       

       if(duplicates == true)

               break;

}    

   if(duplicates == false)

       cout<<"The value of duplicates variable is false meaning "<<duplicates<<endl;    

   return 0;

}  

OUTPUT

This program checks if duplicate values exist in the array.

Enter the number of integers to be inserted in the array.

7

Enter the integers to be inserted in the array.

1234

2345

1234

5678

9087

6554

4560

3456

6789

The value of duplicates variable is true meaning 1  

Explanation:

The variables mentioned in the question are used as required. There is no logic applied to validate user input. It is assumed that user inputs only valid values.

This program is designed to check whether duplicate values are present in the array. The boolean variable duplicates is assigned value true or false depending on the presence of duplicate values.

The user is prompted the number of values to be put in the array along with those values.

Once the array is filled, the array is checked for identical values. If any identical value is present, the value of duplicates variable is assigned to true and the loop is discontinued.

If no identical values are present, the loop completes and duplicates variables is assigned the value of false.

In either case, the value of the duplicates variable is displayed.

3 0
2 years ago
Read 2 more answers
Which of the following is an advantage of inserting a page number field in your document rather than inserting each page number
Artyom0805 [142]

The advantage of inserting the page number field is that the page number field could show the current page number.

The following information should be relevant with respect to the page number:

  • The page number field & the actual page number should be formatted.
  • The page number field & the actual page number both could be inserted into the header or footer.
  • The page number field & the actual page number could be easily inserted into the document.

Therefore we can conclude that the advantage of inserting the page number field is that the page number field could show the current page number.

Learn more about the page number here: brainly.com/question/3063419

8 0
1 year ago
You're the sole IT employee at your company, and you don't know how many users or computers are in your organization. Uh oh! Wha
Neporo4naja [7]

Answer

Directory Services

<u></u>

<u>Definition</u>

It is a type of software that is used to unify and customize the resources available at the network.

<u>Explanation</u>

This software is used to gather the information and addresses of all computers connected on the network.

It is a type of information store, where all the information related to resources (computer) and services of network has been stored. It also gives administrator rights to the single point to manage whole network resources.

This is the reason, Option "D" is the best choice for me as sole IT employ in a company. I will prefer directory services software to gather the information of all computers of organization and manage users in company.  

4 0
2 years ago
In the program below, what is the scope of strFirst?
MAXImum [283]

First, we have to understand what scope is. When variables are declared, they are only available in the code block they're declared in, unless they're global variables (this doesn't apply here).

strFirst is declared in usernameMaker and that is the only place it is available in.

5 0
1 year ago
Read 2 more answers
Other questions:
  • Which of the following statements is not true about proper tire care? a.If you see a wear bar across the width of the tread whil
    14·2 answers
  • A major weakness of a lot of file processing systems is that ____.
    10·1 answer
  • What company built its first computer from a wooden box
    12·2 answers
  • The icacls.exe command adds __________, which are visible by clicking the Advanced button in the folder Properties dialog box
    15·1 answer
  • Suppose a host has a 1-MB file that is to be sent to another host. The file takes 1 second of CPU time to compress 50%, or 2 sec
    12·1 answer
  • Create a division formula.
    9·1 answer
  • Your project must satisfy the following requirements:
    7·1 answer
  • Consider the packets exchanged in TCP connection setup between Host A and Host B. Assume that Host A's initial sequence number i
    7·1 answer
  • Probability of theft in an area is 0.03 with expected loss of 20% or 30% of things with probabilities 0.55 and 0.45. Insurance p
    5·1 answer
  • How does Accenture help companies harness the power of data to achieve optimal business outcomes?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!