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
1. Which of the following is not true about high-level programming language s? (a) Easy to read and write (b) Popular among prog
vazorg [7]

Answer:

1: c

2: c

Explanation:

The higher-level the language, the more it resembles human language.

In Python, the print() statement outputs text.

6 0
2 years ago
Which two components are configured via software in order for a PC to participate in a network environment
dalvyx [7]

Answer:

IP address and subnet mask.

Explanation:

The two components which are configured via software in order for a personal computer (PC) to participate in a network environment are;

I. IP address: it is an acronym for internet protocol address and can be defined as a unique number assigned to a computer or other network devices, so as to differentiate each device from one another in an active network system. Thus, an IP address is typically used to uniquely identify each computer or network devices connected to the internet or network.

In Computer networking, IP address are classified into two (2) main categories and these are; Local (internal) IP address and Global (external) IP address.

Also, the internet protocol (IP) address comprises of two (2) versions and these are; Internet protocol version 4 (IPv4) and Internet protocol version 6 (IPv6). An example of an IPv4 address is 192.168.1.0.

II. Subnet mask: this is a logical segmentation or subdivision of an internet protocol (IP) network so as to accommodate more hosts (computer systems). An example of a subnet mask is 255.255.0.0.

6 0
2 years ago
In vehicles equipped with ABS, the driver's foot must remain firmly on the _________ to activate the ABS.
DanielleElmas [232]
<span>The driver’s foot must remain firmly on the brake pedal to activate the ABS.

An Anti-lock Brake system (ABS) is an effective braking system if used correctly. It simply keeps the foundation braking systems from locking up. It allows the driver to maintain directional stability and in some cases, reduces stopping distances during emergency situations when a driver slams the brake.
The foot of those drivers in vehicles equipped with ABS should remain firmly on the brake pedal, allowing this system to automatically kick in. In case of a slippery road or a panic stop, an Anti-lock Brake system prevents wheel lock up and helps your vehicle maintain a straight line</span>
3 0
3 years ago
Read 2 more answers
How many fonts are there in a theme?<br> A. 1<br> B. 2<br> C. 4<br> D. 5
BlackZzzverrR [31]

B. 2

If incorrect, sorry

6 0
3 years ago
चार फरक छुट्याउनुहोस् ।) 3. Write down any four provisions of cyber ethic साइबर नैतिकताका कुनै चार प्रावधानहरु लेख्नुहोस् ।​
Kruka [31]

Answer:

Five provisions of cyber ethics are:

Your computer or system should not be used to harm others. Your cyber knowledge should not be used to steal other people's resources. One should not use or copy softwares for which you have not paid. ... Never use other people's resources without their consent.

7 0
2 years ago
Other questions:
  • What of the following google tools support collaboration
    10·1 answer
  • Due to the internal style sheets of some browsers, your website may look different to someone who is using firefox as opposed to
    11·1 answer
  • What are some causes of the number of bytes on the wire exceeding the number of bytes being captured?
    6·2 answers
  • An Internet Service Provider (ISP) is a company that builds the routers and wired connections that allow individuals to access t
    12·2 answers
  • An investor is considering in which of two start-up companies to invest. The investor has faith in the industrial organization (
    9·2 answers
  • CORRECT ANSWER GETS BRAINLIEST
    8·2 answers
  • Help me please. I dont really understand this.
    12·2 answers
  • Difference between centralized and decentralized processing in computer
    7·1 answer
  • if we intend to include a servo motor as an actuator, what feature should we include when selecting a microcontroller?
    7·1 answer
  • Each of the flowchart segments in Figure 3-24 is unstructured. Redraw each segment so that it does the same processes under the
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!