Kizspy.me1.
You are asked to write a console application that includes:
The delegate named TaxCalculation that take a Product as input parameter and return one double.
The class Product that contains:
Four public properties (not public fields): Id (int), Name (string), Type (string) and Price (double).
Necessary constructors.
Two public methods:
public void Display(TaxCalculation c)
that display information of product with the tax calculated in the way of delegate c.
public static double Display(List<Product> products, TaxCalculation c)
that using the method Display(TaxCalculation) above to display information of all products in list
products.
With the main function given in Figure 1 below, your code must have the same result as the Figure 2.
Note that the grader may use a different main function.
30
31
32
34
Zoom
static void Main(string[] args)
Console.WriteLine("Testcase 1:");
Product p new Product(1, "Dell XPS 13 7390", "Computer", 1000);
p.Display(x-(x.Type.Equals("Computer") ? x.Price 0.1 x.Price 0.05));
+ 80%
Close