-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Aufgabe 7 Bearbeitet und Benutzerfreundlichkeit geändert
- Loading branch information
Arthur Leon Dyga
committed
Nov 23, 2022
1 parent
4571cad
commit 44cba39
Showing
6 changed files
with
80 additions
and
4 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
double Gewicht; | ||
Console.WriteLine("BMI rechner"); | ||
double Gewicht; | ||
double größe; | ||
double BMI; | ||
|
||
|
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,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<RootNamespace>_7WochenTage</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
</Project> |
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,56 @@ | ||
Console.WriteLine("Wochentag Berechner"); | ||
Console.WriteLine(); | ||
Console.WriteLine("Jahr"); | ||
int Jahr = Convert.ToInt32(Console.ReadLine()); | ||
Console.WriteLine("Monat"); | ||
int m = Convert.ToInt32(Console.ReadLine()); | ||
Console.WriteLine("Tag"); | ||
int q = Convert.ToInt32(Console.ReadLine()); | ||
int K = Jahr % 100; | ||
int J = Jahr / 100; | ||
int h; | ||
string Ergebniss = "A"; | ||
|
||
if (m == 1) | ||
{ | ||
m += 13; | ||
} | ||
|
||
else if (m == 2) | ||
{ | ||
m += 14; | ||
} | ||
|
||
h = (q + (((m + 1) * 26) / 10)+K + (K / 4) + (J / 4) - 2 * J); | ||
h %= 7; | ||
|
||
if (h < 0) | ||
{ | ||
h += 7; | ||
} | ||
|
||
switch (h) | ||
{ | ||
case 1: | ||
Ergebniss = "Sonntag"; | ||
break; | ||
case 2: | ||
Ergebniss = "Montag"; | ||
break; | ||
case 3: | ||
Ergebniss = "Dienstag"; | ||
break; | ||
case 4: | ||
Ergebniss = "Mittwoch"; | ||
break; | ||
case 5: | ||
Ergebniss = "Donnerstag"; | ||
break; | ||
case 6: | ||
Ergebniss = "Freitag"; | ||
break; | ||
case 7: | ||
Ergebniss = "Samsatag"; | ||
break; | ||
} | ||
Console.WriteLine($"Der wochentag lautet: {Ergebniss}"); |
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