I'm learning from the book Use the Head and there is the following code to do an exercise of random items
public class Menu
{
public Random Randomico;
string[] Carnes = { "Rosbife", "Salame", "Peru", "Presunto", "Pastrami" };
string[] Condimentos = { "Mostarda amarela", "Mostarda Marrom", "Mostarda com mel", "Maionese", "Molho Francês", "Gosto" };
string[] Paes = { "Centeio", "Branco", "Trigo", "Pão italiano", "Pão integral", "árabe" };
}
public string ItemMenu() {
string ramdonCarne = Carnes[Randomizer.Next(Carnes.Lenght)];
string ramdonCondimento = Condimentos[Randomizer.Next(Condimentos.Lenght)];
string ramdonPao = Paes[Randomizer.Next(Paes.Lenght)];
return ramdonCarne + "com " + ramdonCondimento + "no " + ramdonPao;
}
However, in Visual Studio, it is giving error when creating the ItemMenu method, but the book does not tell you anything about something unusual that might happen.
Someone could help me.