Commit 109e7c4f authored by Uwe Wienkop's avatar Uwe Wienkop

Klasse Person WS2015/16

parent 8308931d
<?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>{84F9B5F3-7359-4ED7-910E-4974C54A2FBC}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>_11KlassePersonWS1516</RootNamespace>
<AssemblyName>11KlassePersonWS1516</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 _11KlassePersonWS1516
{
enum MTyp { Angestellter, Gruppenleiter, Abteilungsleiter}
class Person
{
string name;
double gehalt;
int persnr;
MTyp eingruppierung;
static int naechstePersNr=1;
public Person(string Name, double Gehalt, MTyp Eingruppierung,int PersNr=-1)
{
name = Name;
gehalt = Gehalt;
eingruppierung = Eingruppierung;
if (PersNr == -1)
persnr = naechstePersNr++;
// Nimm' naechstePersNr und speichere sie in PersNr
// Dann erhöhe naechstePersNr um 1
else if (PersNr >= naechstePersNr)
{
persnr = PersNr;
naechstePersNr = persnr + 1;
}
else
throw new ArgumentOutOfRangeException("Unzulässige Personalnummer");
}
public static int NaechstePersNr
{
get { return naechstePersNr; }
set
{
if (value >= naechstePersNr)
naechstePersNr = value;
else
throw new ArgumentOutOfRangeException();
}
}
public static double Gehaltsvolumen(Person [] Pfeld, MTyp Mitarbeitertyp)
{
double gehaelter = 0;
foreach (Person p in Pfeld)
{
if (p.eingruppierung == Mitarbeitertyp)
gehaelter += p.gehalt;
}
return gehaelter;
}
}
class Program
{
static void Main(string[] args)
{
Person.NaechstePersNr = 100;
Person[] personen = {
new Person("Huber",2000,MTyp.Abteilungsleiter),
new Person("Meier",2200,MTyp.Gruppenleiter) };
double gehaelter = Person.Gehaltsvolumen(personen, MTyp.Gruppenleiter);
}
}
}
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("11KlassePersonWS1516")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("11KlassePersonWS1516")]
[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("84f9b5f3-7359-4ed7-910e-4974c54a2fbc")]
// 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")]
......@@ -83,6 +83,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "10CallByReference", "10Call
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "11StringFunktionen", "11StringFunktionen\11StringFunktionen.csproj", "{083C94EB-CBE5-4465-B3C4-5286DAD35D14}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "11KlassePersonWS1516", "11KlassePersonWS1516\11KlassePersonWS1516.csproj", "{84F9B5F3-7359-4ED7-910E-4974C54A2FBC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -237,6 +239,10 @@ Global
{083C94EB-CBE5-4465-B3C4-5286DAD35D14}.Debug|Any CPU.Build.0 = Debug|Any CPU
{083C94EB-CBE5-4465-B3C4-5286DAD35D14}.Release|Any CPU.ActiveCfg = Release|Any CPU
{083C94EB-CBE5-4465-B3C4-5286DAD35D14}.Release|Any CPU.Build.0 = Release|Any CPU
{84F9B5F3-7359-4ED7-910E-4974C54A2FBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{84F9B5F3-7359-4ED7-910E-4974C54A2FBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{84F9B5F3-7359-4ED7-910E-4974C54A2FBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{84F9B5F3-7359-4ED7-910E-4974C54A2FBC}.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