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
Leni [432]
3 years ago
13

Using your choice of C# or Java (NOT in Pseudocode), write an abstract class Vehicle. The Vehicle class contains at least these

two attributes: id (int type) and model (String type) and an abstract method vehicleDetail() that will have two arguments for the vehicle id and model. Then write two concrete classes Car and Bus that inherit the Vehicle class and implement the abstract method that displays vehicle id and model. You don't need to include the main () method.
Computers and Technology
2 answers:
vodka [1.7K]3 years ago
7 0

Answer:

public abstract class Vehicle

   {

       private int  id;

       public int  ID

       {

           get { return id; }

           set { id = value; }

       }

       private string model;

       public string Model

       {

           get { return model; }

           set { model = value; }

       }

       public abstract string VehicleDetail(int id, string model);

   }

   public class Car : Vehicle

   {

       public Car()  {  }

       public Car(int id, string model)

       {

           ID = id;

           Model = model;

       }

       public override string VehicleDetail(int id, string model)

       {

           return $"{id} - {model}";

       }

   }

   public class Bus : Vehicle

   {

       public Bus(int id, string model, string make)

       {

           ID = id;

           Model = model;

           Make = make;

       }

       public string Make { get; set; }

       public override string VehicleDetail(int id, string model, string make)

       {

           return $"{id} - {model}" - {make};

       }

   }

Explanation:

konstantin123 [22]3 years ago
3 0
<h2>Answer:</h2>

//Declare the abstract class  

//by using the "abstract" keyword as follows

abstract class Vehicle {

 

   //declare the attributes of the class

   int id;

   String model;

   

   //declare the abstract method, vehicleDetail()

   //which has two arguments: id and model

   //and has no implementation

   abstract void vehicleDetail(int id, String model);

   

}   //End of abstract class declaration

 

========================================================

//Create the Car class to inherit from the Vehicle class

//by using the "extends" keyword as follows

public class Car extends Vehicle {

   //Implement the abstract method in the Vehicle class

   //writing statements to print out the id and model as follows;

   void vehicleDetail(int id, String model) {

       System.out.println("Id : " + id);

       System.out.println("Model : " + model);

       

   }  //End of vehicleDetail method

   

}  //End of class declaration

==========================================================

//Create the Bus class to inherit from the Vehicle class

//by using the "extends" keyword as follows

public class Bus extends Vehicle {

   //Implement the abstract method in the Vehicle class

   //by writing statements to print out the id and model as follows;

   void vehicleDetail(int id, String model) {

       System.out.println("Id : " + id);

       System.out.println("Model : " + model);

       

   }   //End of vehicleDetail method

   

}  //End of class declaration

================================================================

<h2>Explanation:</h2>

The above code has been written in Java and it contains comments explaining every line of the code. Please go through the comments.

The actual lines of code have been written in bold-face to differentiate them from comments.

You might be interested in
If your database is in archivelog mode, how can you force an archive?
MA_775_DIABLO [31]

Answer: (B) Issue an alter system switch logfile command.

Explanation:

 When the database is in the archive log mode then, the issue in the alter system switch logfile command force the particular switch. It basically produce achieve redo log which is smaller in the size by the dedicated size of the parameter log buffer.

It also govern the particular size of the RAM (Random access memory) buffer by redo log.  This command is basically faster to return in the program by the use of redo log.

On the other hand, all the options are incorrect as this command only alter the system and does not alter the database. Therefore, Option (B) is correct.

 

8 0
3 years ago
How many spaces should you use for an indent?
vladimir1956 [14]
I believe it's 5 spaces for an indent. If that's incorrect plz forgive me lol.
7 0
3 years ago
Using a windows computer, to expand a branch of the folder tree you would _____.
s344n2d4d5 [400]
A folder can include everything from documents and music, to applications [like Word or Excel or your favorite browser]. But computer folders can also contain other folders, lots of them, and those sub-folders can contain folders of their own. This is the called folder tree. The trunk of the tree is the Desktop. Then there are several folders like Recycle Bin, Control Panel,..The most important branch is the one called ‘Libraries’. Here are the Photos, Music, Videos,...
<span>Using a windows computer, to expand a branch of the folder tree you would right click </span>beside various folders and drives to expand the folder tree.

8 0
3 years ago
In your own words, what is pair-programming? What is the role of the driver? What is the role of the navigator? What are some be
KATRIN_1 [288]

<u>Paired programming:</u>

Paired programming is a new technique where one person gets one another to<em> write the code</em>. Here one will write the code and other will start verifying as the type.

So we might think it is waste to employ two person for same task but it is not so. There are many <em>benefits in incorporating this technique</em>. Let us see those benefits one by one.

  • <em>Inter-personal skill gets improved </em>
  • <em>Lower amount of coding mistake </em>
  • <em>Learn from each other </em>
  • <em>Peer review enhance collaboration </em>

Challenges expect to arise during pair-programming

  • Two heads are superior to one. On the off chance that the driver experiences a <em>hitch with the code</em>, there will be two of them who'll take care of the issue.  
  • Builds up your <em>staff's relational aptitudes</em>. Working together on a solitary venture encourages your group to welcome the estimation of <em>correspondence and collaboration.  </em>

Overcome Method

The most ideal approach to move <em>toward blending</em> is to accomplice two software engineers and have them share a PC. The pair ought to have the option to choose how to part the work, and it is prudent that they should <em>switch jobs frequently.</em>

7 0
3 years ago
The system should enable the staff of each academic department to examine the courses offered by their department, add and remov
Ganezh [65]

Answer:

See attached picture.

Explanation:

See attached picture.

3 0
3 years ago
Other questions:
  • The maximum number of colors that should be used on a slide is _____. 2 4 6 8
    12·2 answers
  • When uninstalling software, it is best to delete the folder containing the software?
    11·1 answer
  • A tornado may be approaching if you observe which of the following?
    15·1 answer
  • How did the invention of the printing press lead eventually to an increase in the diversity of religious expression?
    7·1 answer
  • What are some strategies that you can use when you debug a program?
    11·1 answer
  • The network layer of the Internet model uses the _____________ protocol to route messages though the network.
    13·1 answer
  • Nate wants to copy the style of his contact address to the normal template. Complete the paragraph to describe how he can access
    6·1 answer
  • Select the statements that are true regarding the future of technology. Select 2 options.
    12·1 answer
  • How do you award a brainliest
    8·2 answers
  • Match the following.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!