๐ WAYPOINT LESSON
Checkpoint โ Data models
โญ beginnerโณ 20 min read๐ Lesson 45 of 85
A catalog of products: an enum category, a record line item with value equality, and aggregation over a list.
Checkpoint: the product catalog
Task: implement in Solution:
enum Category { Books, Electronics, Food }record Item(string Name, Category Cat, decimal Price)static decimal Total(List<Item> items, Category cat)โ sum of prices for items in exactly that category; null/empty list or no matches โ 0.static Item? MostExpensive(List<Item> items)โ the item with the highest price; null/empty โnull. Ties: return any one.