diff --git a/Kreise/KreisControl.cs b/Kreise/KreisControl.cs new file mode 100644 index 0000000000000000000000000000000000000000..d555ecb0741fbfa8bd94ffcd3f3930cdd1949874 --- /dev/null +++ b/Kreise/KreisControl.cs @@ -0,0 +1,8 @@ +using System; + +public class Class1 +{ + public Class1() + { + } +} diff --git a/Kreise/Kreise.sln b/Kreise/Kreise.sln new file mode 100644 index 0000000000000000000000000000000000000000..883cd172a7e0ca1e102594a3babf38c06fc393eb --- /dev/null +++ b/Kreise/Kreise.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32901.215 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kreise", "Kreise\Kreise.csproj", "{E6F71A14-4352-4CEF-A722-21C21E791268}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E6F71A14-4352-4CEF-A722-21C21E791268}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E6F71A14-4352-4CEF-A722-21C21E791268}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E6F71A14-4352-4CEF-A722-21C21E791268}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E6F71A14-4352-4CEF-A722-21C21E791268}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9018CD44-3E56-4E43-8FF5-677DAD0ECE06} + EndGlobalSection +EndGlobal diff --git a/Kreise/Kreise/Kreis.cs b/Kreise/Kreise/Kreis.cs new file mode 100644 index 0000000000000000000000000000000000000000..188868882bc3ae2b09b52ae70447d835e0244ba8 --- /dev/null +++ b/Kreise/Kreise/Kreis.cs @@ -0,0 +1,50 @@ +using System; +using System.Drawing; + +namespace Kreise +{ + internal class kreis + { + double radius = 0; // Radius des Kreises + Color farbe; // Die Farbe des Kreises mit dem Typ "Color" aus einer Bibliothek + + // ToDo 1: Was fehlt noch für die Definition eins Kreises? + + /// <summary> + /// Konstruktor der Klasse + /// </summary> + public Kreis() + { + // Dies ist der Konstruktor der Klasse. Immer, wenn ein Objekt dieser Klasse erzeugt wird, + // dann wird dieser als erstes ausgeführt. + + + // ToDo 1a: Initialisierung der Zustandseigenschaften + // Dies könnten Standardwerte sein x,y=0, r=1, Farbe=weiss, + // oder Sie können aber auch an den Konstruktor Parameter übergeben, + // welche Sie dann für die Initalisierung des Zustandes nutzen können. + + farbe = Color.White; // Beispiel für eine Farbzuweisung + } + + /// <summary> + /// Berechnung der Fläche des Kreises + /// </summary> + /// <returns>Fläche des Kreises</returns> + public double getFlaeche() + { + return (Math.PI * Math.Pow(radius, 2)); + } + + public void setFarbe(Color farbe) + { + this.farbe = farbe; + } + + // ToDo 2: Ergänzen Sie die Methode setRadius + + // ToDo 3: Ergänzen Sie die Methode getRadius + + + } +} diff --git a/Kreise/Kreise/KreisControl.cs b/Kreise/Kreise/KreisControl.cs new file mode 100644 index 0000000000000000000000000000000000000000..314cd29039ae4a8b62d42a01f90a5d02717c5454 --- /dev/null +++ b/Kreise/Kreise/KreisControl.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Kreise +{ + internal class KreisControl + { + /// <summary> + /// Konstruktor der Klasse + /// </summary> + KreisControl() + { + } + + /// <summary> + /// In dieser Methode werden Kreise, also erzeugt + /// </summary> + public void ErzeugeKreise() + { + new Kreis(); // Instanziierung eines Kreises + // ToDo 4: Berechnen Sie die Fläche von mehreren Kreisen + + // ToDo 5: Eingabe und Ausgabe schreiben ??? + } + + static void Main() + { + KreisControl kc = new KreisControl(); + kc.ErzeugeKreise(); + + } + + } +} diff --git a/Kreise/Kreise/Kreise.csproj b/Kreise/Kreise/Kreise.csproj new file mode 100644 index 0000000000000000000000000000000000000000..c73e0d1692ab38cc8596bbd32ae080d903aaa778 --- /dev/null +++ b/Kreise/Kreise/Kreise.csproj @@ -0,0 +1,8 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>netcoreapp3.1</TargetFramework> + </PropertyGroup> + +</Project>