Gromov

Untitled

Oct 21st, 2020
624
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class advertising:
  2.     __name: str
  3.     __price: float
  4.     __coverage: int
  5.  
  6.     def __init__(self, name, price, coverage):
  7.         self.__name = name
  8.         self.__price = price
  9.         self.__coverage = coverage
  10.  
  11.     def get_name(self):
  12.         return self.__name
  13.  
  14.     def get_price(self):
  15.         return self.__price
  16.  
  17.     def get_coverage(self):
  18.         return self.__coverage
  19.  
  20.     def set_name(self, name):
  21.         self.__name = name
  22.  
  23.     def set_price(self, price):
  24.         self.__price = price
  25.  
  26.     def set_coverage(self, coverage):
  27.         self.__coverage = coverage
  28.  
  29.     def ppu(self):
  30.         return self.__price / self.__coverage
  31.  
  32.  
  33. class Socmedia(advertising):
  34.     __stats: int
  35.     type = "VK"
  36.  
  37.     def __init__(self, name, price, coverage, stats):
  38.         self.__stats = stats
  39.         super().__init__(name, price, coverage)
  40.  
  41.     def get_stats(self):
  42.         return self.__stats
  43.  
  44.     def set_stats(self, stats):
  45.         self.__stats = stats
  46.  
  47.     def get_type(self):
  48.         return self.type
  49.  
  50.     def statper(self):
  51.         return super().__price / (self.__stats / 1000 )
  52.  
  53.  
  54.  
  55. class Target(advertising):
  56.     __country = str
  57.     type = "Target audience "
  58.  
  59.     def __init__(self, country, name, price, coverage):
  60.         self.__country = country
  61.         super().__init__(name, price, coverage)
  62.  
  63.     def get_country(self):
  64.         return self.__country
  65.  
  66.     def set_country(self, country):
  67.         self.__country = country
  68.  
  69. name = input("\nEnter advertising company name: ")
  70. price = input("Enter price: ")
  71. coverage = int(input("Enter coverage: "))
  72. stats = int(input("Enter statistics: "))
  73.  
  74. pr_comp1 = Socmedia(name, price, coverage, stats)
  75.  
  76. name = input("\nEnter advertising company name: ")
  77. price = input("Enter price: ")
  78. coverage = int(input("Enter coverage: "))
  79. country = input("Enter country: ")
  80.  
  81. pr_comp2 = Target(country, name, price, coverage)
  82.  
  83. print("Type: ", str(pr_comp1.get_type()), " Advertising \n PR-company name: ", str(pr_comp1.get_name()),
  84.       "\nPrice: ", float(pr_comp1.get_price()), "\nCoverage: ", int(pr_comp1.get_coverage()), "\nStatistics: ",
  85.       int(pr_comp1.get_stats()), "\nPrice per 1000 views: ", int(pr_comp1.statper()))
  86.  
RAW Paste Data