Answer to Question #261839 in Python for mt3

Question #261839

We are hungry college students, and we are developing an app to help us find the closest restaurants, in restaurant.py. Your job is to implement the functions below that represent the restaurant abstract data type.

A restaurant is an abstract data type that has a name, a longitude coordinate, and a latitude coordinate. We create a restaurant like this:


1
Expert's answer
2021-11-06T03:15:52-0400
#Creating Constructor object and functions
class restaurants: 
    def __init__(self, name, longitude, latitude): 
        self.name = name.lower() 
        self.longitude = longitude
        self.latitude = latitude


    def get_name(self):   
      return self.name


    def get_longitude(self):
      return self.longitude


    def get_latitude(self):
      return self.latitude
  
#Creating a new object
mac = restaurants("McDonald's", 73.843918, 18.517768)


mac.get_name()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS