36
37
38
39
40
41
42
43
44
45
Console.WriteLine("\nTestcase 2:");
List<Product> products new List<Product> {
new Product(2, "Dell Inspiron 15 5505", "Computer", 850),
new Product (2, "Dell XPS 15 9550", "Computer", 2500),
new Product(2, "Inspot 5.7L", "Houseware", 200)
};
Product.Display(products,
(x => (x.Type.Equals("Computer") ? x.Price 0.15: x.Price * 0.05)));
Figure 1: Main function
}
The output should be the same as below
Testcase 1:
Product: Id:1
Name: Dell XPS 13 7390
Type: Computer
Price:1000
Tax:100
Zoom
Testcase 2:
List of products:
Product: Id:2 Name: Dell Inspiron 15 5505 Product: Id:2 Name: Dell XPS 15 9550 Type: Computer Price:2500 Tax:375
Type: Computer Price:850
Product: Id:2 Name: Inspot 5.7L Type: Houseware Price: 200
Tax:10
Tax:127,5
Figure 2: Output screen
+ 100%
Close