generated from GSO-SW/MultiTool
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d53b81b
commit b053f9a
Showing
6 changed files
with
127 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ public class Feature11 | |
public static void Feature_11() | ||
{ | ||
Zufallszahlengenerator.Run(); | ||
|
||
} | ||
} | ||
|
||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
using System; | ||
|
||
namespace WIKlassenBibliothek | ||
{ | ||
internal class Feature16 | ||
{ | ||
internal static void Feature_16() | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Blue; | ||
Console.WriteLine("Willkommen zum Nebenkosten Rechner von Amannat"); | ||
Console.ResetColor(); | ||
|
||
double kaltmiete = 0; | ||
double warmmiete = 0; | ||
bool validInput = false; | ||
|
||
while (!validInput) | ||
{ | ||
Console.WriteLine("Bitte geben Sie die Kaltmiete ein (oder 'exit' zum Beenden):"); | ||
string input = Console.ReadLine(); | ||
if (input.ToLower() == "exit") | ||
{ | ||
return; | ||
} | ||
|
||
if (double.TryParse(input, out kaltmiete)) | ||
{ | ||
validInput = true; | ||
} | ||
else | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Red; | ||
Console.WriteLine("Ungültige Eingabe! Bitte geben Sie eine gültige Zahl ein."); | ||
Console.ResetColor(); | ||
} | ||
} | ||
|
||
validInput = false; | ||
|
||
while (!validInput) | ||
{ | ||
Console.WriteLine("Bitte geben Sie die Warmmiete ein (oder 'exit' zum Beenden):"); | ||
string input = Console.ReadLine(); | ||
if (input.ToLower() == "exit") | ||
{ | ||
return; | ||
} | ||
|
||
if (double.TryParse(input, out warmmiete)) | ||
{ | ||
validInput = true; | ||
} | ||
else | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Red; | ||
Console.WriteLine("Ungültige Eingabe! Bitte geben Sie eine gültige Zahl ein."); | ||
Console.ResetColor(); | ||
} | ||
} | ||
|
||
double nebenkosten = warmmiete - kaltmiete; | ||
|
||
Console.ForegroundColor = ConsoleColor.Yellow; | ||
Console.WriteLine($"Die Nebenkosten betragen: {nebenkosten}"); | ||
Console.ResetColor(); | ||
|
||
bool validAnswer = false; | ||
|
||
while (!validAnswer) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("\nMöchten Sie eine detaillierte Aufschlüsselung der Nebenkosten? (Ja/Nein oder 'exit' zum Beenden):"); | ||
string antwort = Console.ReadLine().ToLower(); | ||
Console.ResetColor(); | ||
|
||
if (antwort == "ja") | ||
{ | ||
Console.WriteLine("\n*** Detaillierte Aufschlüsselung der Nebenkosten ***"); | ||
Console.WriteLine($"Warmmiete: {warmmiete} €"); | ||
Console.WriteLine($"Kaltmiete: {kaltmiete} €"); | ||
Console.WriteLine($"Nebenkosten: {nebenkosten} €"); | ||
validAnswer = true; | ||
} | ||
else if (antwort == "nein") | ||
{ | ||
validAnswer = true; | ||
} | ||
else if (antwort == "exit") | ||
{ | ||
return; | ||
} | ||
else | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Red; | ||
Console.WriteLine("Ungültige Antwort! Bitte antworten Sie mit 'Ja' oder 'Nein' (oder 'exit' zum Beenden)."); | ||
Console.ResetColor(); | ||
} | ||
} | ||
|
||
Console.ForegroundColor = ConsoleColor.Magenta; | ||
Console.WriteLine("\nVielen Dank für die Nutzung des Rechners. Drücken Sie eine beliebige Taste, um das Programm zu beenden."); | ||
Console.ResetColor(); | ||
|
||
Console.ReadKey(); | ||
} | ||
} | ||
} |
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
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