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
andre [41]
2 years ago
9

Write a class named Taxicab that has three **private** data members: one that holds the current x-coordinate, one that holds the

current y-coordinate, and one that holds the odometer reading (the actual odometer distance driven by the Taxicab, not the Euclidean distance from its starting point). The class should have an init method that takes two parameters and uses them to initialize the coordinates, and also initializes the odometer to zero. The class should have get methods for each data member: get_x_coord, get_y_coord, and get_odometer. The class does not need any set methods. It should have a method called move_x that takes a parameter that tells how far the Taxicab should shift left or right. It should have a method called move_y that takes a parameter that tells how far the Taxicab should shift up or down. For example, the Taxicab class might be used as follows:
Computers and Technology
1 answer:
Licemer1 [7]2 years ago
7 0

Answer:

See explaination

Explanation:

class Taxicab():

def __init__(self, x, y):

self.x_coordinate = x

self.y_coordinate = y

self.odometer = 0

def get_x_coord(self):

return self.x_coordinate

def get_y_coord(self):

return self.y_coordinate

def get_odometer(self):

return self.odometer

def move_x(self, distance):

self.x_coordinate += distance

# add the absolute distance to odometer

self.odometer += abs(distance)

def move_y(self, distance):

self.y_coordinate += distance

# add the absolute distance to odometer

self.odometer += abs(distance)

cab = Taxicab(5,-8)

cab.move_x(3)

cab.move_y(-4)

cab.move_x(-1)

print(cab.odometer) # will print 8 3+4+1 = 8

You might be interested in
Which of the following calculations would evaluate to 12?
lidiya [134]

Answer:

the answer for this is 3*(6+2)/2)

8 0
2 years ago
One of your co-workers has been issued a new smart card because the old one has expired. The co-worker can connect to the comput
Lady_Fox [76]

Answer:

The answer is "The global Address List (GAL) is publishes in the new certificates".

Explanation:

Describe the GAL with relate to smart card:

  • The GAL is a part of the outlook, that allows the users to make a group of mutual contacts and resources specified for your G Suite domain and searchable directory.  
  • It provides the main mail app, that offers you to make global contacts, and also provides basic contact, with the use of business shares global addresses with others.  In this process, the co-worker can change their smart card.
5 0
3 years ago
How does a computer resolve a domain name into an ip address?
Yanka [14]

Answer:

Using the DNS service.

Explanation:

The computer sends a UDP packet with the domain name in it to port 53 of the configured DNS server, and expects a reply with the IP address of that domain.

8 0
3 years ago
Photographs that are too dark or too light can be difficult to fix with photo-editing software.
Nana76 [90]
The answer is true :)
6 0
2 years ago
Read 2 more answers
A​ client-server application that requires nothing more than a browser is called​ ________.
goblinko [34]
Hello  <span>Tacobell5401</span>

 Answer: A​ client-server application that requires nothing more than a browser is called​  thin-client application


Hope this helps
-Chris
3 0
3 years ago
Read 2 more answers
Other questions:
  • ________ sets up a point-to-point connection between two computer systems over an Internet Protocol (IP) network. A. Point-to-Po
    15·1 answer
  • Which presentation software element can you use to create a model diagram with two concentric circles inside a triangle?
    10·2 answers
  • Don't pat any attention to this
    7·2 answers
  • You must have an active ____ to test external links.
    5·1 answer
  • Proxy download for school
    15·2 answers
  • What will the following code display?
    12·1 answer
  • Write a program that passes an unspecified number of integers from command line and displays their total.
    5·1 answer
  • A large number of consecutive IP addresses are available starting at 198.16.0.0. Suppose that four organizations, Able, Baker, C
    11·1 answer
  • 11 Select the correct answer. Which external element groups items in a design?
    9·1 answer
  • Physical and data link layer standards govern transmission in ________. LANs WANs Both LANs and WANs Neither LANs nor WANs
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!