#OOPR-Assgn-25
#Start writing your code here

class FruitInfo:
    __fruit_name_list = ['Apple', 'Guava', 'Orange', 'Grape', 'Sweet Lime']
    __fruit_price_list = [100, 800, 70, 110, 600]
    
    @staticmethod
    def get_fruit_price(fruit_name):
        if fruit_name.title() in FruitInfo.__fruit_name_list:
            return FruitInfo.__fruit_price_list[FruitInfo.__fruit_name_list.index(fruit_name.title())]
        else:
            return -1
            
    @staticmethod
    def get_fruit_name_list():
        return FruitInfo.__fruit_name_list
        
    @staticmethod
    def get_fruit_price_list():
        return FruitInfo.__fruit_price_list
        
        
class Purchase:
    __counter=101
    def __init__(self, customer,fruit_name, quantity):
        self.__purchase_id = None
        self.__customer = customer
        self.__fruit_name = fruit_name.title()
        self.__quantity = quantity
        
    def get_purchase_id(self):
        return self.__purchase_id
        
    def get_customer(self):
        return self.__customer
        
    def get_quantity(self):
        return self.__quantity
        
    def calculate_price(self):
        fruit_price=FruitInfo.get_fruit_price(self.__fruit_name)
        if fruit_price>0:
            self.__purchase_id = 'P' + str(Purchase.__counter)
            Purchase.__counter += 1
            price = fruit_price*self.__quantity
            
            if fruit_price == max(FruitInfo.get_fruit_price_list()) and self.__quantity>1:
                price *= 0.98
            if fruit_price == min(FruitInfo.get_fruit_price_list()) and self.__quantity>=5:
                price *= 0.95
            if self.__customer.get_cust_type() == 'wholesale':
                price *= 0.90
            return (price)
        else:
            return -1
                
            
class Customer():
    def __init__(self, customer_name, cust_type):
        self.__customer_name = customer_name.title()
        self.__cust_type = cust_type.lower()
        
    def get_customer_name(self):
        return self.__customer_name
        
    def get_cust_type(self):
        return self.__cust_type
        
cust1 = Customer("ABC", "wholesale")
p = Purchase(cust1,"Apple", 10)
print(p.calculate_price())
29609b600c97bcf2860713a82152905812516dc2
<mask token>


class Purchase:
    <mask token>

    def __init__(self, customer, fruit_name, quantity):
        self.__purchase_id = None
        self.__customer = customer
        self.__fruit_name = fruit_name.title()
        self.__quantity = quantity

    def get_purchase_id(self):
        return self.__purchase_id

    def get_customer(self):
        return self.__customer

    def get_quantity(self):
        return self.__quantity
    <mask token>


class Customer:

    def __init__(self, customer_name, cust_type):
        self.__customer_name = customer_name.title()
        self.__cust_type = cust_type.lower()

    def get_customer_name(self):
        return self.__customer_name

    def get_cust_type(self):
        return self.__cust_type


<mask token>

class FruitInfo:
    <mask token>
    <mask token>
    <mask token>

    @staticmethod
    def get_fruit_name_list():
        return FruitInfo.__fruit_name_list
    <mask token>


class Purchase:
    __counter = 101

    def __init__(self, customer, fruit_name, quantity):
        self.__purchase_id = None
        self.__customer = customer
        self.__fruit_name = fruit_name.title()
        self.__quantity = quantity

    def get_purchase_id(self):
        return self.__purchase_id

    def get_customer(self):
        return self.__customer

    def get_quantity(self):
        return self.__quantity

    def calculate_price(self):
        fruit_price = FruitInfo.get_fruit_price(self.__fruit_name)
        if fruit_price > 0:
            self.__purchase_id = 'P' + str(Purchase.__counter)
            Purchase.__counter += 1
            price = fruit_price * self.__quantity
            if fruit_price == max(FruitInfo.get_fruit_price_list()
                ) and self.__quantity > 1:
                price *= 0.98
            if fruit_price == min(FruitInfo.get_fruit_price_list()
                ) and self.__quantity >= 5:
                price *= 0.95
            if self.__customer.get_cust_type() == 'wholesale':
                price *= 0.9
            return price
        else:
            return -1


class Customer:

    def __init__(self, customer_name, cust_type):
        self.__customer_name = customer_name.title()
        self.__cust_type = cust_type.lower()

    def get_customer_name(self):
        return self.__customer_name

    def get_cust_type(self):
        return self.__cust_type


<mask token>

class FruitInfo:
    __fruit_name_list = ['Apple', 'Guava', 'Orange', 'Grape', 'Sweet Lime']
    __fruit_price_list = [100, 800, 70, 110, 600]

    @staticmethod
    def get_fruit_price(fruit_name):
        if fruit_name.title() in FruitInfo.__fruit_name_list:
            return FruitInfo.__fruit_price_list[FruitInfo.__fruit_name_list
                .index(fruit_name.title())]
        else:
            return -1

    @staticmethod
    def get_fruit_name_list():
        return FruitInfo.__fruit_name_list

    @staticmethod
    def get_fruit_price_list():
        return FruitInfo.__fruit_price_list


class Purchase:
    __counter = 101

    def __init__(self, customer, fruit_name, quantity):
        self.__purchase_id = None
        self.__customer = customer
        self.__fruit_name = fruit_name.title()
        self.__quantity = quantity

    def get_purchase_id(self):
        return self.__purchase_id

    def get_customer(self):
        return self.__customer

    def get_quantity(self):
        return self.__quantity

    def calculate_price(self):
        fruit_price = FruitInfo.get_fruit_price(self.__fruit_name)
        if fruit_price > 0:
            self.__purchase_id = 'P' + str(Purchase.__counter)
            Purchase.__counter += 1
            price = fruit_price * self.__quantity
            if fruit_price == max(FruitInfo.get_fruit_price_list()
                ) and self.__quantity > 1:
                price *= 0.98
            if fruit_price == min(FruitInfo.get_fruit_price_list()
                ) and self.__quantity >= 5:
                price *= 0.95
            if self.__customer.get_cust_type() == 'wholesale':
                price *= 0.9
            return price
        else:
            return -1


class Customer:

    def __init__(self, customer_name, cust_type):
        self.__customer_name = customer_name.title()
        self.__cust_type = cust_type.lower()

    def get_customer_name(self):
        return self.__customer_name

    def get_cust_type(self):
        return self.__cust_type


<mask token>
print(p.calculate_price())

class FruitInfo:
    __fruit_name_list = ['Apple', 'Guava', 'Orange', 'Grape', 'Sweet Lime']
    __fruit_price_list = [100, 800, 70, 110, 600]

    @staticmethod
    def get_fruit_price(fruit_name):
        if fruit_name.title() in FruitInfo.__fruit_name_list:
            return FruitInfo.__fruit_price_list[FruitInfo.__fruit_name_list
                .index(fruit_name.title())]
        else:
            return -1

    @staticmethod
    def get_fruit_name_list():
        return FruitInfo.__fruit_name_list

    @staticmethod
    def get_fruit_price_list():
        return FruitInfo.__fruit_price_list


class Purchase:
    __counter = 101

    def __init__(self, customer, fruit_name, quantity):
        self.__purchase_id = None
        self.__customer = customer
        self.__fruit_name = fruit_name.title()
        self.__quantity = quantity

    def get_purchase_id(self):
        return self.__purchase_id

    def get_customer(self):
        return self.__customer

    def get_quantity(self):
        return self.__quantity

    def calculate_price(self):
        fruit_price = FruitInfo.get_fruit_price(self.__fruit_name)
        if fruit_price > 0:
            self.__purchase_id = 'P' + str(Purchase.__counter)
            Purchase.__counter += 1
            price = fruit_price * self.__quantity
            if fruit_price == max(FruitInfo.get_fruit_price_list()
                ) and self.__quantity > 1:
                price *= 0.98
            if fruit_price == min(FruitInfo.get_fruit_price_list()
                ) and self.__quantity >= 5:
                price *= 0.95
            if self.__customer.get_cust_type() == 'wholesale':
                price *= 0.9
            return price
        else:
            return -1


class Customer:

    def __init__(self, customer_name, cust_type):
        self.__customer_name = customer_name.title()
        self.__cust_type = cust_type.lower()

    def get_customer_name(self):
        return self.__customer_name

    def get_cust_type(self):
        return self.__cust_type


cust1 = Customer('ABC', 'wholesale')
p = Purchase(cust1, 'Apple', 10)
print(p.calculate_price())

#OOPR-Assgn-25
#Start writing your code here

class FruitInfo:
    __fruit_name_list = ['Apple', 'Guava', 'Orange', 'Grape', 'Sweet Lime']
    __fruit_price_list = [100, 800, 70, 110, 600]
    
    @staticmethod
    def get_fruit_price(fruit_name):
        if fruit_name.title() in FruitInfo.__fruit_name_list:
            return FruitInfo.__fruit_price_list[FruitInfo.__fruit_name_list.index(fruit_name.title())]
        else:
            return -1
            
    @staticmethod
    def get_fruit_name_list():
        return FruitInfo.__fruit_name_list
        
    @staticmethod
    def get_fruit_price_list():
        return FruitInfo.__fruit_price_list
        
        
class Purchase:
    __counter=101
    def __init__(self, customer,fruit_name, quantity):
        self.__purchase_id = None
        self.__customer = customer
        self.__fruit_name = fruit_name.title()
        self.__quantity = quantity
        
    def get_purchase_id(self):
        return self.__purchase_id
        
    def get_customer(self):
        return self.__customer
        
    def get_quantity(self):
        return self.__quantity
        
    def calculate_price(self):
        fruit_price=FruitInfo.get_fruit_price(self.__fruit_name)
        if fruit_price>0:
            self.__purchase_id = 'P' + str(Purchase.__counter)
            Purchase.__counter += 1
            price = fruit_price*self.__quantity
            
            if fruit_price == max(FruitInfo.get_fruit_price_list()) and self.__quantity>1:
                price *= 0.98
            if fruit_price == min(FruitInfo.get_fruit_price_list()) and self.__quantity>=5:
                price *= 0.95
            if self.__customer.get_cust_type() == 'wholesale':
                price *= 0.90
            return (price)
        else:
            return -1
                
            
class Customer():
    def __init__(self, customer_name, cust_type):
        self.__customer_name = customer_name.title()
        self.__cust_type = cust_type.lower()
        
    def get_customer_name(self):
        return self.__customer_name
        
    def get_cust_type(self):
        return self.__cust_type
        
cust1 = Customer("ABC", "wholesale")
p = Purchase(cust1,"Apple", 10)
print(p.calculate_price())