Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Delivery:
- def __init__(self, tracking_number, sender_office, receiver_office, sender_name, phone_number, amount, deadline):
- self.tracking_number = tracking_number
- self.sender_office = sender_office
- self.receiver_office = receiver_office
- self.sender_name = sender_name
- self.phone_number = phone_number
- self.amount = amount
- self.deadline = deadline
- def display_info(self):
- print(f"Tracking Number: {self.tracking_number}")
- print(f"Sender Office: {self.sender_office}")
- print(f"Receiver Office: {self.receiver_office}")
- print(f"Sender Name: {self.sender_name}")
- print(f"Phone number: {self.phone_number}")
- print(f"Amount: {self.amount}")
- print(f"Deadline: {self.deadline}")
- def change_deadline(self, new_deadline):
- self.deadline = new_deadline
- class PaymentMethod:
- CARD = "Card"
- BANK_TRANSFER = "Bank Transfer"
- CASH_ON_DELIVERY = "Cash on Delivery"
- class DeliveryMethod:
- OFFICE_PICKUP = "Office Pickup"
- AUTOMAT = "Automat"
- HOME_DELIVERY = "Home Delivery"
- class DeliveryManager:
- def __init__(self):
- self.deliveries = []
- def add_delivery(self, delivery):
- self.deliveries.append(delivery)
- def check_tracking_number(self, phone_number):
- return len(phone_number) == 13 # Проверка за дължина 10 символа
- if __name__ == "__main__":
- delivery_manager = DeliveryManager()
- tracking_number = input("Enter tracking number: ")
- sender_office = input("Enter sender office: ")
- receiver_office = input("Enter receiver office: ")
- sender_name = input("Enter sender name: ")
- phone_number = int(input("Enter phone number: +359"))
- amount = float(input("Enter amount: "))
- deadline = input("Enter deadline (On Time or Delayed): ")
- delivery = Delivery(tracking_number, sender_office, receiver_office, sender_name, phone_number, amount, deadline)
- print("\nУспешно регистрирана пратка!")
- delivery.display_info()
- print()
- #клас който да въведеш тел. номер и да ти принтира инф. за пратката
- print("\nИнформация за получаване на пратка:")
- delivery_manager.add_delivery(delivery)
- phnone_number_to_check = int(input("Enter phone number to check: +359"))
- if phnone_number_to_check == delivery.phone_number:
- print("Phone number is valid.\n")
- else:
- print("Invalid phone number.")
- new_deadline = input("Enter new deadline (On Time or Delayed): ")
- delivery.change_deadline(new_deadline)
- delivery.display_info()
- print()
- print("1 - Плащане с карта \n"
- "2 - Плащане в брой")
- payment = int(input("Изберете метод за плащане:"))
- if payment == 1:
- print("Плащане с карта")
- payment_method = PaymentMethod.CARD
- else:
- print("Плащане в брой")
- delivery_method = DeliveryMethod.HOME_DELIVERY
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement