add Programmyday form github
This commit is contained in:
37
WareHouseSolution/Program.cs
Normal file
37
WareHouseSolution/Program.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
namespace WareHouseSolution
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
string[] name = { "OTTO", "HERTIE", "KAUFHOF", "COOP", "UDO" };
|
||||
Warenhaus[] kette = new Warenhaus[5];
|
||||
for (int i = 0; i < kette.Length; i++)
|
||||
{
|
||||
kette[i] = new Warenhaus(name[i], 10 * (i + 1), 100 * (i + 1));
|
||||
kette[i].PrintInfos();
|
||||
}
|
||||
Warenhaus.PrintInfosGesamt();
|
||||
Random rnd = new Random();
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
int warenhaus = rnd.Next(kette.Length);
|
||||
int aktion = rnd.Next(2);
|
||||
int anzahl = rnd.Next(1,6);
|
||||
if (aktion == 0)
|
||||
{
|
||||
kette[warenhaus].Einkauf(anzahl);
|
||||
}
|
||||
else
|
||||
{
|
||||
kette[warenhaus].Verkauf(anzahl);
|
||||
}
|
||||
}
|
||||
foreach (Warenhaus wh in kette)
|
||||
{
|
||||
wh.PrintInfos();
|
||||
}
|
||||
Warenhaus.PrintInfosGesamt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user