Commit 303433e7 authored by Uwe Wienkop's avatar Uwe Wienkop

Intro Funktionen

parent 258daa22
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E808CF6E-A1D8-4E3D-BC74-902C1DCF0B0C}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>_03Funktionen</RootNamespace>
<AssemblyName>03Funktionen</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _03Funktionen
{
class Program
{
static void Main(string[] args)
{
double a = 3, b = 4;
int c = Quersumme(12345);
Console.WriteLine(c);
}
static int Quadriere(int x)
// int Quadriere --> Quadriere liefert ein int-Ergebnis
// int v --> Eingangsparameter, hier vom Typ int
{
return x*x;
// return liefert das Ergebnis zurück
}
static int Quersumme(int zahl)
{
int qs = 0;
while (zahl != 0)
{
qs += zahl % 10; // qs = qs + zahl2 % 10
zahl = zahl / 10;
}
return qs;
}
}
}
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("03Funktionen")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("03Funktionen")]
[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("e808cf6e-a1d8-4e3d-bc74-902c1dcf0b0c")]
// 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")]
......@@ -10,11 +10,11 @@ namespace _03Schleifentypen
{
static void Main(string[] args)
{
for (int i = 50; i>=1; i--) // int i=50 --> Deklariert die int-Var. i und
// initialisiert sie mit 50
// i>=1 --> Durchlaufbedingung; wird VOR jedem
// Schleifendurchlauf getestet, auch for dem Ersten
// i-- --> Weiterschalten der Schleifenvariable
for (int i = 50; i >= 1; i--) // int i=50 --> Deklariert die int-Var. i und
// initialisiert sie mit 50
// i>=1 --> Durchlaufbedingung; wird VOR jedem
// Schleifendurchlauf getestet, auch for dem Ersten
// i-- --> Weiterschalten der Schleifenvariable
{
Console.Write($"{i} ");
}
......@@ -40,7 +40,17 @@ namespace _03Schleifentypen
Console.WriteLine("Bitte Zahl im Bereich 1..10 eingeben");
x = Convert.ToInt32(Console.ReadLine());
}
while (x<1 || x >10); // Schleifenrumpf wird wiederholt, wenn die Bed. wahr ist
while (x < 1 || x > 10); // Schleifenrumpf wird wiederholt, wenn die Bed. wahr ist
Console.WriteLine("==========");
int m=5;
for (m=5; ; )
{
if (m%6000 == 0)
Console.WriteLine(m);
}
Console.WriteLine("----------");
Console.WriteLine(m);
}
}
}
......@@ -32,6 +32,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "03QuersummeWPF", "03Quersum
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "03Zahlendarstellungen", "03Zahlendarstellungen\03Zahlendarstellungen.csproj", "{EB5CF8FD-04CF-4EED-B4CB-BBCA2223F252}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "03Funktionen", "03Funktionen\03Funktionen.csproj", "{E808CF6E-A1D8-4E3D-BC74-902C1DCF0B0C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -86,6 +88,10 @@ Global
{EB5CF8FD-04CF-4EED-B4CB-BBCA2223F252}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB5CF8FD-04CF-4EED-B4CB-BBCA2223F252}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB5CF8FD-04CF-4EED-B4CB-BBCA2223F252}.Release|Any CPU.Build.0 = Release|Any CPU
{E808CF6E-A1D8-4E3D-BC74-902C1DCF0B0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E808CF6E-A1D8-4E3D-BC74-902C1DCF0B0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E808CF6E-A1D8-4E3D-BC74-902C1DCF0B0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E808CF6E-A1D8-4E3D-BC74-902C1DCF0B0C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment