A sweets store offers a variety of products. The store requires a program to manage customers' sweets boxes. First create a class sweets which contains all the products, this class has two attributes the reference number of a piece and the weight of a piece. The constructor of this class must check, when a product is created, that the price is not equal to zero, if so it displays an error message. Creates a display method that displays the weight and reference of each piece.



Answer :

Other Questions