Commit 95301af5 authored by Uwe Wienkop's avatar Uwe Wienkop

Updates

parent 63c94bbe
......@@ -16,23 +16,18 @@ namespace _11KlassePersonWS1516
static int naechstePersNr=1;
public Person(string Name, double Gehalt, MTyp Eingruppierung,int PersNr=-1)
public Person(string Name, double Gehalt, MTyp Eingruppierung,
int PersNr = -1)
{
name = Name;
gehalt = Gehalt;
eingruppierung = Eingruppierung;
if (PersNr == -1)
persnr = naechstePersNr++;
if (PersNr > 0)
NaechstePersNr = PersNr;
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
{
......
......@@ -12,17 +12,18 @@ namespace _13KlasseKreis_WS2011_12
double radius, x, y;
Fuellart art;
public Kreis(double X, double Y, double Radius, Fuellart fa=Fuellart.dotted)
public Kreis(double X=0, double Y=0, double Radius=0,
Fuellart fa=Fuellart.dotted)
{
x = X;
y = Y;
radius = Radius;
art = fa;
}
public Kreis (double R):this (0,0,R,Fuellart.dotted)
{ }
public Kreis() : this(0, 0, 0, Fuellart.dotted)
{ }
//public Kreis (double R):this (0,0,R,Fuellart.dotted)
//{ }
//public Kreis() : this(0, 0, 0, Fuellart.dotted)
//{ }
public static void Verschiebe(Kreis that, double deltaX, double deltaY)
{
that.x += deltaX;
......
......@@ -11,22 +11,26 @@ namespace _13ToStringKonvertierung
static string Int2String(int x)
{
string erg = "";
while (x>0)
while (x > 0)
{
int letzteZiffer = x % 10;
erg = (char)(letzteZiffer+'0') + erg;
erg = (char)(letzteZiffer + '0') + erg;
x /= 10;
}
return erg;
}
static string Int2String2(int x)
static string Int2String2(int x, int Basis)
{
string erg = "";
while (x>0)
while (x > 0)
{
int ersteZiffer = x / 10;
erg += (char)(ersteZiffer + '0');
int letzteZiffer = x % Basis;
if (letzteZiffer < 10)
erg = (char)(letzteZiffer + '0') + erg;
else
erg = (char)(letzteZiffer - 10 + 'A') + erg;
x /= Basis;
}
return erg;
}
......@@ -42,9 +46,10 @@ namespace _13ToStringKonvertierung
}
return false;
}
static void Main(string[] args)
static void Main(string[] args)
{
Console.WriteLine(Int2String(12300456));
Console.WriteLine(Int2String2(0xaffe, 16));
double.
}
}
}
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