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
What is a collection of computing resources that are elastic and highly virtualized?
In-s [12.5K]

Answer:

private cloud

Explanation:

I just know

5 0
3 years ago
Which of the following correctly describes a work in the public domain?
Anarel [89]

Answer:

B

Explanation:

I took the test got a 100

8 0
3 years ago
Memememememmemememememememmmeememememe
Alexus [3.1K]

l o l l o l l o l ha ha ha ha ha l o l

7 0
2 years ago
Which detail should be included in a summary about the passage check all that apply in warm rivers play role in arctic sea ice m
SSSSS [86.1K]

Answer:

A. Warm water is melting the Arctic Sea ice.

C. The sudden flow of warm waters into the sea are rapidly warming the ocean's surface.

Explanation:

ed2020

5 0
3 years ago
It's 50 points.
Mashutka [201]

Answer:

When I was younger I had a dream about being popular for my studies. everyone knew that I worked hard and devoted to studies. Two years ago I took an admission to a different school, no one knew I studied well how I hittin famous was quite unique. It was hard for students to carry textbooks, a rule was made for textbooks to be in a cupboard. I was the monitor of the cupboard and had keys for it. once in my mathematics class my classmates were shouting my name "SALENA! SALENA! so I would give them there books. maam out of frustration asked "Who is SALENA!? I raised my hand from behind maam in an embarrassed manner. My teacher noticed me and realized I'm a brilliant student.

Explanation:

I hope you have a nice! I tried to shorten it has much as I could. I hope this helps you!

3 0
3 years ago
Read 2 more answers
Other questions:
  • What is data consolidation?
    9·1 answer
  • Read each statement below. If the statement describes a peer-to-peer network, put a P next to it. If the statement describes a s
    13·2 answers
  • When does information become a liability for an organization
    6·1 answer
  • Which of the following statements are true?
    13·1 answer
  • High level language - An object oriented programming language​
    5·1 answer
  • 14. Which of the following is NOT a
    6·2 answers
  • Give an idea of a law u would like to create
    5·2 answers
  • Which user interface part shows graphical output of mined data?
    8·2 answers
  • Which browser feature will delete your history, cache, and cookies the moment you close the special window
    6·1 answer
  • suppose a malloc implementation returns 8-byte aligned addresses and uses an explicit free list where the next and previous poin
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!