Skip to content

Commit

Permalink
fixed a bug where the application got closed after one run
Browse files Browse the repository at this point in the history
  • Loading branch information
GLifeDE committed Apr 25, 2021
1 parent f306ac4 commit 44ce386
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions Durchschnittsrechner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,14 @@ static void Main(string[] args)

ConsoleKeyInfo input;

string decission = Console.ReadLine();

do
{
switch (decission)
input = Console.ReadKey();
if (input.Key != ConsoleKey.Enter)
{
case "ja":
Console.Clear();
Program.Programm();
break;
case "Ja":
Console.Clear();
Program.Programm();
break;
case "JA":
Console.Clear();
Program.Programm();
break;
case "jA":
Console.Clear();
Program.Programm();
break;
Console.Clear();
Program.Programm();
}
input = Console.ReadKey();
} while (input.Key != ConsoleKey.Enter);


Expand Down Expand Up @@ -112,7 +96,7 @@ static void Programm()

Console.WriteLine(" ");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("Um den Rechner neu zu starten, müssen sie *Ja* eintippen. Ansonsten Enter drücken.");
Console.WriteLine("Drücken sie alles *außer* Enter um den Rechner neu zu starten. Um ihn zu beenden drücken sie Enter.");
}
}
}

0 comments on commit 44ce386

Please sign in to comment.