Created
September 3, 2022 07:04
-
-
Save syedjafer/4448131a03d0fa78623bd5358558f0c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Customer: | |
def __init__(self, address, title, first_name, last_name): | |
self.__address = address | |
self.__title = title | |
self.__first_name = first_name | |
self.__last_name = last_name | |
def get_title(self): | |
return self.__title | |
def set_title(self, title): | |
self.__title = title | |
def set_first_name(self, first_name): | |
self.__first_name = first_name | |
def get_first_name(self): | |
return self.__first_name | |
def set_last_name(self, last_name): | |
self.__last_name = last_name | |
def get_last_name(self): | |
return self.__last_name | |
def set_address(self, address): | |
self.__address = address | |
def get_address(self): | |
return self.__address | |
def get_customer_summary(self): | |
return self.__title + " " + self.__first_name + " " + self.__last_name + self.__address.get_address_summary() | |
class Address: | |
def __init__(self, city, post_code, country): | |
self.__city = city | |
self.__post_code = post_code | |
self.__country = country | |
def get_city(self): | |
return self.__city | |
def set_city(self, city): | |
self.__city = city | |
def get_country(self): | |
return self.__country | |
def set_country(self, country): | |
self.__country = country | |
def get_postcode(self): | |
return self.__postcode | |
def set_postcode(self, postcode): | |
self.__postcode = postcode | |
def get_address_summary(self): | |
return self.__city + ", " + self.__postcode + ", " + self.__country | |
class CustomerSummaryView: | |
def __init__(self, customer): | |
self.customer = customer | |
def get_customer_summary(self): | |
return self.customer.get_customer_summary() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment