Was ist bei meinem C# Code falsch?
using System;
namespace NeuArray
{
class Programm
{
static void Main()
{
string[,] products = new string[2, 5];
products[0, 0] = "Senf";
products[1, 0] = "1.99 Euro";
products[0, 1] = "Smartphone";
products[1, 1] = "Preis: 1299 Euro";
products[0, 2] = "Schokolade";
products[1, 2] = "2.99 Euro";
products[0, 3] = "Obst";
products[1, 3] = "1.49 Euro";
products[0, 4] = "Couch";
products[1, 4] = "499 Euro";
Start:
Console.Write("Gib die Spalte ein von dem Produkt das du suchst: ");
int Spalte = Convert.ToInt32(Console.ReadLine());
if (Spalte < 0 || Spalte > 5)
{
Console.WriteLine("Diese Spalte existiert nicht. ");
goto Start;
}
Console.WriteLine("Das gesuchte Produkt lautet: " + products[0, Spalte]);
Console.WriteLine("Möchtest du den Preis dieses Produktes sehen? Geben Sie 1 ein für Ja und 2 für Nein ");
int Abfrage = Convert.ToInt32(Console.ReadLine());
switch (Abfrage)
{
case 1:
Console.WriteLine(products[1, Spalte]);
break;
case 2:
Abfrage2:
Console.WriteLine("Möchten Sie nach einem neuen Produkt suchen? Geben Sie 1 ein für Ja und 2 für Nein");
int AbfrageProduktNeu = Convert.ToInt32(Console.ReadLine());
if ((AbfrageProduktNeu == 1))
{
goto Start;
}
else if (AbfrageProduktNeu == 2)
{
Console.WriteLine("Programm beendet.");
}
else
{
Console.WriteLine("Ungültige Eingabe.");
goto Abfrage2;
}
break;
}
}
}
}
Es steht zwar nicht, dass irgendwo ein Fehler ist aber immer wenn ich das Programm in der Konsole ausgeben will steht da "Hot Reload".
Könnt ihr mir helfen bitte?