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
saw5 [17]
4 years ago
8

Write a class named Car that has the following data attributes: __year_model: (for the car's year model) __make: (for the make o

f the car) __speed: (for the car's current speed) In addition, the class should have the following methods: __init__ method that accepts the car’s year model and make as arguments. These values should be assigned to the object’s __year_model and __make data attributes. It should also assign 0 to the __speed data attribute. accelerate: The accelerate method should add 5 to the speed data attribute when it is called. brake: The brake method should subtract 5 from the speed data attribute eachtime it is called. get_speed: The get_speed method should return the current speed
Computers and Technology
1 answer:
rewona [7]4 years ago
7 0

Answer: Provided in the explanation section

Explanation:

Provided below is the program to carry out this task, i hope you can follow it clearly.

Program is run below

class Car:

   def __init__(self, model, make):

       self.__year_model = model

       self.__make = make

       self.__speed = 0

   def accelerate(self):

       self.__speed += 5

   def brake(self):

       self.__speed -= 5

   def get_speed(self):

       return self.__speed

car = Car("F1", "Ferrari")

for i in range(5):

   car.accelerate()

   print(car.get_speed())

for i in range(5):

   car.brake()

   print(car.get_speed())

cheers i hope this helped !!

You might be interested in
In black and white,<br><br> we must be more conscious of image
scZoUnD [109]

is it true or false is so it is false

3 0
3 years ago
Basil was reading about a new attack that forces the system to abandon a higher cryptographic security mode of operation and ins
Murljashka [212]

Since Basil was reading about a new attack that forces the system to abandon a higher cryptographic security mode of operation and the kind of attack is known to be Downgrade attack.

<h3>What is downgrade security attack?</h3>

A downgrade attack is known  to be a kind of of cyber attack that is made up of the fact that an attacker is known to often forces a network channel to make a switch to a kind of an unprotected or one that is said to be less secure data transmission standard.

Note also that the  Downgrading of a given protocol version is said to be a key element of  a type of a  man-in-the-middle attacks, and it is known to be one that is often used to take or hijack encrypted traffic.

Hence, Since Basil was reading about a new attack that forces the system to abandon a higher cryptographic security mode of operation and the kind of attack is known to be Downgrade attack

Learn more about Downgrade attack from

brainly.com/question/24304791

#SPJ1

3 0
2 years ago
Before a program written in c can be executed on a computer, what step is required to be done first?
sergejj [24]
It should be compiled. It won't work if it's not compiled.
6 0
4 years ago
50 POINTS!!!
ycow [4]

Answer:

1. -> B.

2. -> C

3. -> A

Explanation:

1. Antennas = help the router fetch and transmit a signal

2. Repeaters = help in increasing the range of signal

3. Adapters = help the device detect a wireless signal

7 0
3 years ago
How do i block somebody on here, theyre making me have a panic attack. /srs
spin [16.1K]

Answer:

If someone is disturbing you a lo then you can report him/her.

  • Go to g-mail.
  • Type a message to US Support.
  • Add a screenshot of him/her whom you want to report.
  • Use polite words
  • At last, send it.

You will get soon response.

5 0
3 years ago
Read 2 more answers
Other questions:
  • True / False<br> Registers are generally optimized for capacity instead of speed.
    14·1 answer
  • Ryan has created a Word document to be used as a review quiz for students in a classroom setting. The document contains both que
    6·1 answer
  • What would you use to compare two date ranges in a report?
    9·1 answer
  • When planning the structure of a spreadsheet, columns are for _______ items and rows are for _______ items.
    5·2 answers
  • This program has some errors in it that are needed to be checked import java.io.*;
    13·1 answer
  • The ____________ mechanism consists of a lever arm attached to the mousetrap spring.
    15·1 answer
  • You might have trouble interpreting a message if:
    15·1 answer
  • Prior to the 1996 NEC, ____ receptacles and cords were permitted. However, now it is mandatory that a separate equipment groundi
    11·1 answer
  • Describe s computer network that you are familiar with ?
    8·1 answer
  • Amber, a network administrator, is conducting VoIP training for other IT team members. Melanie, a new team member, is confused a
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!