Skip to content

Commit

Permalink
added english support
Browse files Browse the repository at this point in the history
  • Loading branch information
GLifeDE committed Apr 24, 2021
1 parent 2163cea commit 8693706
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 7 deletions.
108 changes: 103 additions & 5 deletions Durchschnittsrechner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,30 @@ class Program
{
static void Main(string[] args)
{
Console.Title = "Durchschnittsrechner V2.0";

Console.Title = "Durchschnittsrechner V3.0";

Console.WriteLine("Please select a language:");
Console.WriteLine("1. Deutsch");
Console.WriteLine("2. English");

int lang = Convert.ToInt32(Console.ReadLine());

if (lang == 1)
{
Program.German();
}
else
{
Program.English();
}

}

static void German()
{

Console.Clear();

// Code
int count;

Expand Down Expand Up @@ -40,7 +62,7 @@ static void Main(string[] args)
count = Convert.ToInt32(Console.ReadLine());

Console.ForegroundColor = ConsoleColor.Cyan;

for (int i = 0; i < countH; i++)
{
Console.Write("Gebe eine Hauptfachnote ein: ");
Expand All @@ -59,9 +81,9 @@ static void Main(string[] args)

double totalH = Hauptfachnoten.Sum(x => Convert.ToDouble(x));



result = (((totalH * gewicht) + total) / (count+(countH*2)));

result = (((totalH * gewicht) + total) / (count + (countH * 2)));

Console.ForegroundColor = ConsoleColor.Red;

Expand All @@ -82,7 +104,83 @@ static void Main(string[] args)

//Warte bevor schließen
Console.ReadKey();
}

static void English()
{

Console.Clear();

// Code
int count;

int countH;

int gewicht;

double result;

List<string> Noten = new List<string>();

List<string> Hauptfachnoten = new List<string>();

Console.ForegroundColor = ConsoleColor.Magenta;
Console.WriteLine("*German* Grade Calculator by Rafael Wickberg // GLifeDE");

Console.ForegroundColor = ConsoleColor.White;

Console.Write("How many main subjects are there?: ");
countH = Convert.ToInt32(Console.ReadLine());

Console.Write("What's the weight of the main subject? (e.g. it counts 2 times: 2): ");
gewicht = Convert.ToInt32(Console.ReadLine());

Console.Write("How many subsidiary subjects are there?: ");
count = Convert.ToInt32(Console.ReadLine());

Console.ForegroundColor = ConsoleColor.Cyan;

for (int i = 0; i < countH; i++)
{
Console.Write("Enter a main subject grade: ");
Hauptfachnoten.Add(Console.ReadLine());
}

Console.ForegroundColor = ConsoleColor.DarkCyan;

for (int i = 0; i < count; i++)
{
Console.Write("Enter a subsidiary subject grade: ");
Noten.Add(Console.ReadLine());
}

double total = Noten.Sum(x => Convert.ToDouble(x));

double totalH = Hauptfachnoten.Sum(x => Convert.ToDouble(x));



result = (((totalH * gewicht) + total) / (count + (countH * 2)));

Console.ForegroundColor = ConsoleColor.Red;

Console.WriteLine("The average is " + Math.Round(result, 2));

if (result >= 3)
{
Console.WriteLine("It will be better next time!");
}
else
{
Console.WriteLine("Very good, keep it up!");
}

Console.WriteLine(" ");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("Press any key to exit the calculator.");

//Warte bevor schließen
Console.ReadKey();
}
}
}
4 changes: 2 additions & 2 deletions Durchschnittsrechner/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0")]
[assembly: AssemblyFileVersion("2.0")]
[assembly: AssemblyVersion("3.0")]
[assembly: AssemblyFileVersion("3.0")]
[assembly: NeutralResourcesLanguage("de-DE")]

0 comments on commit 8693706

Please sign in to comment.