From d4b5a7bdbd8f4b3b1d0b887d7ee3bbda18681eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TH-N=C3=BCrnberg?= Date: Mon, 20 Nov 2017 09:28:04 +0100 Subject: [PATCH] =?UTF-8?q?=C3=9Cbergabe=20von=20Feldern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../06Zufallsg\303\274tetest/Program.cs" | 2 +- .../07FelderAlsParameter.csproj | 60 +++++++++++++++++++ .../07FelderAlsParameter/App.config | 6 ++ .../07FelderAlsParameter/Program.cs | 41 +++++++++++++ .../Properties/AssemblyInfo.cs | 36 +++++++++++ Prog1_WS2017-18/Index.html | 2 +- Prog1_WS2017-18/Prog1_WS2017-18.sln | 6 ++ 7 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 Prog1_WS2017-18/07FelderAlsParameter/07FelderAlsParameter.csproj create mode 100644 Prog1_WS2017-18/07FelderAlsParameter/App.config create mode 100644 Prog1_WS2017-18/07FelderAlsParameter/Program.cs create mode 100644 Prog1_WS2017-18/07FelderAlsParameter/Properties/AssemblyInfo.cs diff --git "a/Prog1_WS2017-18/06Zufallsg\303\274tetest/Program.cs" "b/Prog1_WS2017-18/06Zufallsg\303\274tetest/Program.cs" index 23fd6d6..381d7d6 100644 --- "a/Prog1_WS2017-18/06Zufallsg\303\274tetest/Program.cs" +++ "b/Prog1_WS2017-18/06Zufallsg\303\274tetest/Program.cs" @@ -17,7 +17,7 @@ namespace _06Zufallsgütetest { int gewuerfelt = R.Next(0, 20); // anzahlen[gewuerfelt] = anzahlen[gewuerfelt] + 1; -- Richtig - anzahlen[R.Next(0, 20)] = anzahlen[R.Next(0, 20)] +1; //-- Völlig falsch + anzahlen[R.Next(0, 20)] = anzahlen[R.Next(0, 20)] +1; // Völlig falsch: Es werden zwei verschiedene Indices verwendet! // anzahlen[R.Next(0,20)]+=1; -- richtig // anzahlen[R.Next(0,20)]++; -- richtig diff --git a/Prog1_WS2017-18/07FelderAlsParameter/07FelderAlsParameter.csproj b/Prog1_WS2017-18/07FelderAlsParameter/07FelderAlsParameter.csproj new file mode 100644 index 0000000..7966b68 --- /dev/null +++ b/Prog1_WS2017-18/07FelderAlsParameter/07FelderAlsParameter.csproj @@ -0,0 +1,60 @@ + + + + + Debug + AnyCPU + {1A633D3F-B34D-4BEA-95B4-EF35144E08B7} + Exe + Properties + _07FelderAlsParameter + 07FelderAlsParameter + v4.5.2 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Prog1_WS2017-18/07FelderAlsParameter/App.config b/Prog1_WS2017-18/07FelderAlsParameter/App.config new file mode 100644 index 0000000..88fa402 --- /dev/null +++ b/Prog1_WS2017-18/07FelderAlsParameter/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Prog1_WS2017-18/07FelderAlsParameter/Program.cs b/Prog1_WS2017-18/07FelderAlsParameter/Program.cs new file mode 100644 index 0000000..4536523 --- /dev/null +++ b/Prog1_WS2017-18/07FelderAlsParameter/Program.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace _07FelderAlsParameter +{ + class Program + { + static void Ausgeben(int[] feld) + { + //for (int i = 0; i < feld.Length; i++) + //{ + // Console.Write($"{feld[i],4}"); + //} + //Console.WriteLine(); + foreach (int item in feld) + { + Console.Write($"{item,4}"); + } + Console.WriteLine(); + } + static void Incr(int[] feld, int x) + { + for (int i = 0; i < feld.Length; i++) + { + feld[i]+= 1; + } + x += 1; + } + static void Main(string[] args) + { + int m = 1; + int[] f = { 10, 20, 30, 40, 50, 60, 70 }; + Incr(f, m); + Console.WriteLine($"m = {m} "); + Ausgeben(f); + } + } +} diff --git a/Prog1_WS2017-18/07FelderAlsParameter/Properties/AssemblyInfo.cs b/Prog1_WS2017-18/07FelderAlsParameter/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3ecd47d --- /dev/null +++ b/Prog1_WS2017-18/07FelderAlsParameter/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("07FelderAlsParameter")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("07FelderAlsParameter")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("1a633d3f-b34d-4bea-95b4-ef35144e08b7")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Prog1_WS2017-18/Index.html b/Prog1_WS2017-18/Index.html index db770a2..8bc8590 100644 --- a/Prog1_WS2017-18/Index.html +++ b/Prog1_WS2017-18/Index.html @@ -21,7 +21,7 @@