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
Veseljchak [2.6K]
3 years ago
13

Create a derived class called Car that inherits from Vehicle. The constructor should call the base class constructor, with 4 for

doorcount and "rrrrrr" for engine sound. The Car class should override the Move() method to return "vrumm". The Car should implement a method called RoadTrip(), which should return "Not a care in the world
Computers and Technology
1 answer:
Vitek1552 [10]3 years ago
3 0

Answer:

Hi there Foodalexandre! The question is good to revise knowledge on the concepts of classes and inheritance. Please find the answer with explanation below.

Explanation:

We can use a number of different object-oriented programming languages to implement this solution in, such as Java, C++, Ruby, etc. I have chosen to use Python as the language to implement because of the ease with which it can be used. First, I have defined the Vehicle class based on the description from the question, where the constructor (the __init__ method) initializes the door count and the engine sound, and the original Move() method belonging to the Vehicle class is defined. Then I define the Car class which inherits from the Vehicle class making it inherit the Vehicle properties, and initialize the Car class to have door count of 4 and engine sound as 'rrrrrr'. Defining the Move() method again in the Car class overrides the one in the Vehicle class, and the RoadTrip() method is added to return the string as requested in the question.  

class Vehicle(object):  

 def __init__(self, door_count, engine_sound):    

   door_count: door_count      

   engine_sound: engine_sound    

 def Move() :

   return ‘rrrrrr’  

class Car(Vehicle):  

 def __init__(self, door_count, engine_sound):    

   super().__init__(4, ‘rrrrrr’)  

 def Move():    

   return ‘vrumm’    

 def RoadTrip() :    

   return “Not a care in the world”

You might be interested in
Which of the following is a bullet type in the <ul> tag?
dybincka [34]

Answer:

That would be (d) All of these. I hope this helps you!

8 0
3 years ago
Why does the internet constantly lie to me when I ask question I need answers for in school?
notka56 [123]
Well the website that is trying to tell you the answer is usually the problem. Only websites with .org or .gov are usually reliable because they are run by governments institutes. Websites with the tag .com probably will not be reliable because anyone can make a website today and we don't know if those people are reliable or not.
4 0
3 years ago
How did these social media platforms affect or change the way you communicate with other people?
amid [387]

Answer:

The importance of social media in communication is a constant topic of discussion. Online communication has brought information to people and audiences that previously could not be reached. It has increased awareness among people about what is happening in other parts of the world.

Social media networks allow us the opportunity to share opinions with a far wider audience. Another big change that has occurred is that there is now no filter on the way we speak. In the past, unless you spoke to people directly, you had no way to get your message across regardless of your freedom of speech.

Explanation:

<h2>be happy</h2>
8 0
2 years ago
Can someone just help Im really struggling right now<br> Tysm if you help
frutty [35]

That's really really hard, my god Cassie!

Explanation:

I don't know what the answer is. bekos Yu du not is da layer of da peyk Cassie. di ka mukhang dragon

6 0
3 years ago
You and your best friend have both created online career profiles. Within a week, your friend has had three calls for interviews
mart [117]

Answer:

umm what?

Explanation:

4 0
2 years ago
Other questions:
  • Machine language library routines are installed on computers Select one: a. because they can come as part of the operating syste
    15·1 answer
  • Which is the most efficient way to italicize a row of text in every worksheet in a workbook?
    8·1 answer
  • The programs that provide the infrastructure and hardware control necessary for the computer and its peripheral devices are call
    11·1 answer
  • The process of creating a set of instructions that tell a computer how to perform a task is called:
    11·1 answer
  • What is the difference between a rendering engine and a browser engine?
    5·2 answers
  • What are the modes of operation of WLANs?
    5·1 answer
  • What are the functions of online gaming communities?
    12·1 answer
  • What does a proxy server do?
    5·2 answers
  • Write the line that declares a two-dimensional array of strings named chessboard. that is, how would i declare a two-dimension a
    7·1 answer
  • These ones please (:
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!