Created
September 3, 2022 07:02
-
-
Save syedjafer/76add8bc027dae6cd0f62a157e5973dd 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 | |
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 | |
class CustomerSummaryView: | |
def __init__(self, customer): | |
self.customer = customer | |
def get_customer_summary(self): | |
address = self.customer.get_address() | |
return self.customer.get_title() + " " + self.customer.get_first_name() + " " + self.customer.get_last_name() + ", " + address.get_city() + ", " + | |
address.get_post_code() + ", " + address.get_country() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment