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
The set of instructions given to a computer is called _____________________.
adell [148]

Answer:  c) a program.

Explanation:

A computer, is a hardware device, that differs from those with dedicated hardware (like a TV set, a radio, or an old phone) , in that it can be used for different purposes, due to it's a programmable device.

The way in which the computer is instructed to do anything, is by means of a set of instructions to  be read and executed sequentially, which is called a program.

The set of the different programs stored in the computer is which is known as the computer software.

4 0
3 years ago
Project managers used to be common only in the field of _____ technology.
NNADVOKAT [17]

Answer:

Information

Explanation:

Project managers used to be common only in the field of information technology.

3 0
3 years ago
You learned that properly edited resumes are necessary for making a good impression on a university or a potential employer. Dis
beks73 [17]

Answer:

Resume is the important document for job seekers. As much as the resume is better, there is more chance to grab the job.

If the resume is poor, the employer may not call you for the interview.

Explanation:

Resume is the document that create and impression over the potential employer or university.

If someone have very good hard and soft skills, and does not mention all the skills in resume, then employer could not that skills that you may have. Because your resume is the document that represent you when you are not in front of the employer.  This is the first document, presented that, what  you are and how you are beneficial for the company.

<em>If your resume is poor it may cause that He cannot call you for the interview or not considered for that JOB.</em>

5 0
3 years ago
Read 2 more answers
You are a computer Tech. You have been asked to solve a computer problem. The office manager says his computer not working corre
Nat2105 [25]

Answer:

1. Reboot computer .

2. If the issue persists, check if antivirus software is updated; if so, then verify if the problem is only with Office suite, try to save another Word, Excel, Power Point document and running other programs. If the problem is also extended to Excel or Power Point and other programs run properly then:

a. Uninstall Office Suite (documents and information won´t be lost)

b. Reinstall Office Suite  

c.      Run Word, Excel, etc.

Word documents should open properly.

Explanation:

The above procedure should solve the problem given that it was verified and discarded that the malfunction was caused by a virus and upon verifying that the problem was not only with Word, but all applications related to Office Suite, then by reinstalling the software any malfunction could be fixed.

7 0
3 years ago
Read 2 more answers
What is ?
FinnZ [79.3K]

<u>Answer:</u>

A. The opening tag for an HTML document

<u>Explanation:</u>

The question was supposed to be What is < html >?

This tag is used as an opening tag for documents that use HTML.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Danny is editing the text content of a single page on a website he created a year ago. What part of the tag would he have to upd
    11·1 answer
  • What does a transistor do?
    13·2 answers
  • Given an array a, declared to contain 34 elements, write an expression that refers to the last element of the array.
    12·1 answer
  • NEED HELP FAST
    13·2 answers
  • Write java code that displays all the objects in a stack in the order in which they were pushed onto it. after all the objects a
    5·1 answer
  • HIPAA requires the following controls for medical records: A. Encryption of all data B. Technical safeguards C. Physical control
    12·1 answer
  • The word Only is absolute or qualified
    8·2 answers
  • Which online article citation is correctly formatted according to MLA standards?
    15·2 answers
  • Which term refers to a solution to a large problem that is based on the solutions of smaller subproblems. A. procedural abstract
    5·1 answer
  • Place the steps for attaching a file to a message in order from top to bottom.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!