Question: In the retail store scenario, let's look at the portion of customer purchasing items from the retail store. Write a python program to implement the
In the retail store scenario, let's look at the portion of customer purchasing items from the retail store. Write a python program to implement the class diagram given below.Class Description: Bill class:Initialize static variable counter to generatebillamountitemquantity,items: Calculate bill amount based on the items purchased by the customerAccept a dictionary, itemquantity which contains the item id key of the items purchased along with the quantity valueAccept a list, items which contains the list of Item objects available in the storeGenerate bill id starting from prefixed by B and initialize attribute, billid ExBB etc.Calculate bill amount based on the quantity and price of the items purchased by the customerSet attribute, billamount with the calculated bill amountAssume that values in itemquantity and items are always valid. Customer class:paysbillbill: Pay bill based on the bill amountAccept Bill object which contains the details of the bill to be paid by the customerUpdate attribute, paymentstatus to "Paid"Display customer name, bill id and bill amountNote: Perform case insensitive string comparisonFor testing:Create objects of Customer class, Item class and Bill classInvoke generatebillamountitemquantity,items on Bill object by passing the dictionary containing itemid and quantity of items purchased by the Customer and list of Item objectsInvoke paysbill on Customer object by passing the Bill object
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
