Created
March 31, 2018 18:18
-
-
Save dance2die/3a50fa4e91997ac7518f2a55f0332992 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void AverageDemo(List<Order> orders) | |
{ | |
var averageQuantity = orders.Average(order => order.Quantity); | |
var totalQuantities = orders.Sum(order => order.Quantity); | |
var count = orders.Count(); | |
WriteLine($"Average Quantity: {totalQuantities} / {count} = {averageQuantity}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment