add Programmyday form github

This commit is contained in:
Ruben Kallinich
2024-07-25 15:47:46 +02:00
parent 09c8eab938
commit 7362c3d7ce
132 changed files with 3669 additions and 0 deletions

54
warehouse/warenhaus.cs Normal file
View File

@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace warehouse
{
internal class Warehouse
{
private string name;
private int warenbestand;
private int kassenbestand;
public Warehouse(string name, int filialen, int warenbestand, int kassenbestand)
{
this.name = name;
this.warenbestand = warenbestand;
this.kassenbestand = kassenbestand;
}
public void Einkauf()
{
if (this.kassenbestand >= 10)
{
this.kassenbestand -= 10;
this.warenbestand++;
Console.WriteLine($"Kauf ist erfolgt");
}
else
{
Console.WriteLine("Kauf konnte nicht durchgeführt werden.");
}
}
public void Verkauf()
{
if (this.warenbestand > 0)
{
this.kassenbestand += 20;
this.warenbestand--;
Console.WriteLine("Ware wurde verkauft.");
}
else
{
Console.WriteLine("Keine Ware vorhanden.");
}
}
public void PrintInfo()
{
Console.Write($"Name der Kette: {this.name}, Der Warenbestand beträgt: {this.warenbestand} der Kassenbestand beträgt: {this.kassenbestand}");
}
}
}