-
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 4 Bearbeitet und fertiggestellt
- Loading branch information
Arthur Leon Dyga
committed
Nov 17, 2022
1 parent
3746039
commit b46126f
Showing
4 changed files
with
46 additions
and
50 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,51 +1,6 @@ | ||
//Arbeitsauftrag 1 | ||
int Short = 2 * 8; //bytes x 8 | ||
int Integer = 4 * 8; | ||
int Long = 8 * 8; | ||
int Float = 4 * 8; | ||
int Double = 8 * 8; | ||
int Decimal = 16 * 8; | ||
Console.WriteLine($"Short:{Short} Bits / {typeof(short)} hat {sizeof(short)} Bytes / MinValue: {short.MinValue} / MaxValue: {short.MaxValue}"); | ||
Console.WriteLine($"int:{Integer} Bits {typeof(int)} hat {sizeof(int)} Bytes / MinValue: {int.MinValue} / MaxValue: {int.MaxValue}"); | ||
Console.WriteLine($"long:{Long} Bits {typeof(long)} hat {sizeof(long)} Bytes / MinValue: {long.MinValue} / MaxValue: {long.MaxValue}"); | ||
Console.WriteLine($"float:{Float} Bits {typeof(float)} hat {sizeof(float)} Bytes / MinValue: {float.MinValue} / MaxValue: {float.MaxValue}"); | ||
Console.WriteLine($"double:{Double} Bits {typeof(double)} hat {sizeof(double)} Bytes / MinValue: {double.MinValue} / MaxValue: {double.MaxValue}"); | ||
Console.WriteLine($"decimal:{Decimal} Bits {typeof(decimal)} hat {sizeof(decimal)} Bytes / MinValue: {decimal.MinValue} / MaxValue: {decimal.MaxValue}"); | ||
Console.WriteLine(" "); | ||
Console.WriteLine(" "); | ||
Console.WriteLine(" "); | ||
Console.WriteLine(" "); | ||
string a = "Hallo"; | ||
string b = "H"; | ||
|
||
//Arbeitsauuftrag 2 | ||
string Vorname = "Arthur"; | ||
short Alter = 15; | ||
bool Ist_CSharp_Die_Erste_Programmiersprache_Die_sie_Lernen = true; | ||
Console.WriteLine($"Vorname: {Vorname}"); | ||
Console.WriteLine($"Alter: {Alter}"); | ||
Console.WriteLine($"Ist C# Die erste Programmiersprache die sie lernen?: {Ist_CSharp_Die_Erste_Programmiersprache_Die_sie_Lernen}"); | ||
Console.WriteLine(" "); | ||
Console.WriteLine(" "); | ||
Console.WriteLine(" "); | ||
Console.WriteLine(" "); | ||
b += "allo"; | ||
|
||
//Arbeitsauftrag 3 | ||
int DollarZahl = 36; | ||
char Dollar = (char)DollarZahl; | ||
Console.WriteLine($"{DollarZahl}{Dollar}"); | ||
Console.WriteLine(" "); | ||
Console.WriteLine(" "); | ||
Console.WriteLine(" "); | ||
Console.WriteLine(" "); | ||
|
||
//Arbeitsauftrag 4 | ||
Console.WriteLine("Zufällige zahl"); | ||
string Value1 = Console.ReadLine(); | ||
Console.WriteLine("Zufällige Dezimalzahl"); | ||
string Value2 = Console.ReadLine(); | ||
|
||
short Konvertiert1 = Convert.ToInt16(Value1); | ||
double Konvertiert2 = Convert.ToDouble(Value2); | ||
|
||
Console.WriteLine($"Erfolgreich {Konvertiert1} zu {typeof(short)} konvertiert"); | ||
Console.WriteLine($"Erfolgreich {Konvertiert2} zu {typeof(double)} konvertiert"); | ||
Console.ReadLine(); | ||
Console.WriteLine(b); |
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>_4BMI</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,24 @@ | ||
double Gewicht; | ||
double größe; | ||
double BMI; | ||
|
||
Console.WriteLine("Gewicht in KG:"); | ||
Gewicht = Convert.ToDouble(Console.ReadLine()); | ||
|
||
Console.WriteLine("Größe in CM:"); | ||
größe = Convert.ToDouble(Console.ReadLine()); | ||
größe /= 100; | ||
|
||
BMI = Gewicht / Math.Pow(größe, 2); | ||
if (BMI < 18.5) | ||
{ | ||
Console.WriteLine("Sie sind Untergewichtig."); | ||
} | ||
else if (BMI <= 25) | ||
{ | ||
Console.WriteLine("Sie sind Normalgewichtig."); | ||
} | ||
else | ||
{ | ||
Console.WriteLine("Sie sind Übergewichtig"); | ||
} |
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