Build a class that have 3 instances variables : itemname, quantity and price

1.Build a class that have 3 instances variables : itemname, quantity and price. Build a method that can input number of item bought by a customer in XYZ supermarket. (add suitable exception handling type to make sure user input the correct number); itemname, quantity and price will be insert based on number of item bought. (use looping statement) and calculate total price to be paid. Build another method to calculate the total price