Dictionary<string, List<int>> vendasCarros = new Dictionary<string, List<int>> {
{ "Bugatti Veyron", new List<int> { 10, 15, 12, 8, 5 } },
{ "Koenigsegg Agera RS", new List<int> { 2, 3, 5, 6, 7 } },
{ "Lamborghini Aventador", new List<int> { 20, 18, 22, 24, 16 } },
{ "Pagani Huayra", new List<int> { 4, 5, 6, 5, 4 } },
{ "Ferrari LaFerrari", new List<int> { 7, 6, 5, 8, 10 } }
};
Console.WriteLine("=============================");
foreach (string carro in vendasCarros.Keys) {
Console.WriteLine (carro);
}
Console.WriteLine("=============================");
Console.Write ("Selecione o carro que deseja verificar as vendas: ");
string nomeCarro = Console.ReadLine()!;
double mediaVendas = vendasCarros[nomeCarro].Average();
Console.WriteLine ($"A média de vendas do {nomeCarro} é de {mediaVendas}.");
``