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
SmartArt is a Microsoft Office tool for creating what?
Rufina [12.5K]

Explanation:

Create a SmartArt graphic to quickly and easily make a visual representation of your information. You can choose from among many different layouts, to effectively communicate your message or ideas. SmartArt graphics can be created in Excel, Outlook, PowerPoint, and Word, and they can be used throughout Office

and if it correct than give

4 0
2 years ago
Read 2 more answers
Question: 11
levacccp [35]

Answer:

The detail answer to this question is given in the explanation section.

The correct answer is .info

Explanation:

Let look as each statement

p.info.important

this is a specific  because it says

go to important property which is inside info property  which is inside P

.info  is less specific

because it will go to .info No function is  given whose property is this.

p.info

This is some what specific. As it says select .info property which is inside p

4 0
3 years ago
Help fast plzzzzzzzzzzzz ​
eimsori [14]

Answer:

Which question would you like help with?

4 0
3 years ago
Read 2 more answers
Choose all the items that represent potential ways to find a job opening.
NeX [460]

Answer:

company website

Explanation:

4 0
2 years ago
An online game is played with two dice, explain why decomposition will be used in creating the algorithm for the game?
wolverine [178]
Decomposition will be used so you can break down the game into smaller and more manageable parts.
5 0
3 years ago
Read 2 more answers
Other questions:
  • which of the following is true about both the cyber community and the real community like the one you live in,i will give 10 poi
    6·1 answer
  • Please answers the questions 1-15
    6·1 answer
  • Universal Containers is setting up an external Business Intelligence (BI) system and wants to extract 1,000,000 Contact records.
    11·1 answer
  • Camera shock might happen if you do which of the following to your camera?
    6·2 answers
  • This program will read integers from a file and find results from these integers. Open the file, test to make sure the file open
    12·1 answer
  • An investor is considering in which of two start-up companies to invest. The investor has faith in the industrial organization (
    9·2 answers
  • Consider the following code segment: ArrayList bulbs = new ArrayList(); bulbs.add(new Light()); bulbs.remove(0); bulbs.add(new L
    15·2 answers
  • Which of the following are examples of how a company might use consumer data it had collected? a To decide what types of product
    10·1 answer
  • Which type of graph or chart measures
    15·2 answers
  • when demonstrating 2022 altima’s parking assistance, what steering feature should you mention when pointing out how easy the veh
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!