The C# Code has 2 classes: ItemInfo and Payment. itemInfo class hass 3 variables for Number of Items, Price and Discount of the item. In the GetInfo method, I have passed all the values and print it using Console.WriteLine().
The Payment class is inherited from ItemInfo which has one variable total and one method to count and display the grand Total. There is also a Main method in Payment class. I have created the Payment object and called the GetInfo(Inherited from ItemInfo class) and DisplayTotal Method. Finally, the Cash Payment is accepted.