|
|
@ -18,17 +18,18 @@ namespace ConsoleApplication9
|
|
|
|
zahl /= 10;
|
|
|
|
zahl /= 10;
|
|
|
|
} while (zahl > 0);
|
|
|
|
} while (zahl > 0);
|
|
|
|
|
|
|
|
|
|
|
|
querSumme = 0;
|
|
|
|
|
|
|
|
return querSumme;
|
|
|
|
return querSumme;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int pruefeSeriennummer(string seriennummer)
|
|
|
|
public int pruefeSeriennummer(string seriennummer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Buchstaben durch Zahl ersetzen (Grundlage: ASCII zuordnung)
|
|
|
|
// Buchstaben durch Zahl ersetzen (Grundlage: ASCII zuordnung)
|
|
|
|
char[] seriennummerChar = seriennummer.ToCharArray(0,12);
|
|
|
|
char[] seriennummerChar = seriennummer.ToCharArray(0, 12);
|
|
|
|
|
|
|
|
|
|
|
|
int positionszahl = seriennummerChar[0] - 64;
|
|
|
|
int positionszahl = (int)seriennummerChar[0] - 64;
|
|
|
|
seriennummerChar[0] = Convert.ToChar(positionszahl);
|
|
|
|
int q1 = QuerSumme(positionszahl);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(Convert.ToString(q1));
|
|
|
|
|
|
|
|
|
|
|
|
string snqs = new string(seriennummerChar);
|
|
|
|
string snqs = new string(seriennummerChar);
|
|
|
|
|
|
|
|
|
|
|
@ -38,7 +39,8 @@ namespace ConsoleApplication9
|
|
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(Convert.ToString(seriennummerChar[0] + "!!!! \r\n"));
|
|
|
|
Console.WriteLine(Convert.ToString(seriennummerChar[0] + "!!!! \r\n"));
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i <= 10; i++) {
|
|
|
|
for (int i = 0; i <= 10; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(seriennummerChar[i] + "\r\n \r\n");
|
|
|
|
Console.WriteLine(seriennummerChar[i] + "\r\n \r\n");
|
|
|
|
|
|
|
|
|
|
|
@ -47,7 +49,6 @@ namespace ConsoleApplication9
|
|
|
|
Console.WriteLine(Convert.ToString(quersumme));
|
|
|
|
Console.WriteLine(Convert.ToString(quersumme));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//int quersumme = 2;
|
|
|
|
|
|
|
|
//int subtrahend = (quersumme % 9);
|
|
|
|
//int subtrahend = (quersumme % 9);
|
|
|
|
//int result = 8 - subtrahend;
|
|
|
|
//int result = 8 - subtrahend;
|
|
|
|
//if (result == 0) result = 9;
|
|
|
|
//if (result == 0) result = 9;
|
|
|
@ -69,4 +70,3 @@ namespace ConsoleApplication9
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|