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
Will give brainliest!<br> Who created binary, and does anyone have any idea how?
Sphinxa [80]

Answer:

Gottfried Leibniz created it and Leibniz was trying to find a system that converts logic's verbal statements into a pure mathematical one.

6 0
2 years ago
If one breakfast meal of banana lacatan, scrambled egg, plain rice, and hot milk contains 58 grams carbohydrate, 12 grams protei
enyata [817]

Answer:

Total amount of calories = 325

Explanation:

Given:

Amount of carbohydrate = 58 gram

Amount of protein = 12 gram

Amount of fat = 5 gram

Find:

Total amount of calories

Computation:

1 gram protein = 4 calories

1 gram carbohydrate = 4 calories

1 gram fat = 9 calories

Total amount of calories = (58)(4) + (12)(4) + (5)(9)

Total amount of calories = 232 +48 + 45

Total amount of calories = 325

5 0
3 years ago
A(n) ________ is a specific type of computer program that manages all programs on a computer.
Oksi-84 [34.3K]
A kernel manages the whole computer including hardware. In Unix, all processes are launched from systemd/launchd.
4 0
3 years ago
What is the difference between front-end and back-end?
IgorLugansk [536]

Front-end the part with which the user interacts.

usually people who write this are called layout designers what languages ​​are used (Html, css, js)

Beck-end The northern part is the structure of the site due to which it works, this includes the DBMS, logic, etc. which languages ​​will be used(python, php, java)

People who can do both are called: full stack developr

3 0
2 years ago
You have local administrative rights to your computer running windows 7. you cannot find some of the operating system files on y
ElenaW [278]
<span>a. uncheck ���hide protected operating system files��� in folder options</span>
6 0
2 years ago
Other questions:
  • __________ has led to the belief that the Internet is "free".
    8·1 answer
  • Help, please!! A file named "games.txt" exists and has 80 lines of data. You open the file with the following line of code. aFil
    6·1 answer
  • When was internet started in which year​
    13·2 answers
  • It takes 2.5 yards of material to make a dress harleys clothing design estimates that they can produce 48 dresses each week.if t
    15·2 answers
  • Knowing the meaning of the acronym WAS I WHY can be most helpful to you when you?
    14·1 answer
  • In a dark place you have only a match , a twig , campfire logs , and oil lamp and a candle which do you literally first /
    15·1 answer
  • You plan on using cost based pricing. The cost of your product is 10, and you are planning a 30% mark up. What should the price
    14·1 answer
  • You can use tables for layout work. However, in XHTML, each form control should have its own ______ element
    12·1 answer
  • How does a Cloud-first strategy approach a client's migration to the Cloud?by removing outside ecosystem partners from the Cloud
    14·1 answer
  • Criminal investigations are limited to finding data defined in the search ____.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!