Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #OOPR-Assgn-3
- '''
- Implement the Customer class based on the identified class structure and details given below:
- 1. Consider all instance variables and methods to be public
- 2. Assume that bill_amount is initialized with total bill amount of the customer
- 3. Customer is eligible for 5% discount on the bill amount
- 4. purchases(): Compute discounted bill amount and pay bill
- 5. pays_bill(amount): Display, <customer_name> pays bill amount of Rs. <amount>
- Represent few customers, invoke purchases() method and display the details.
- Note: Verification is done only for the class structure.
- '''
- #Start writing your code here
- class Customer:
- def __init__(self):
- self.customer_name=None
- self.bill_amount=None
- def purchases(self):
- self.bill_amount=self.bill_amount-(self.bill_amount*0.05)
- def pays_bill(self,amount):
- self.bill_amount+=amount
- purchases()
- print(self.customer_name,"pays bill amount of Rs.",bill_amount)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement