Adding interface Tasks

This commit is contained in:
2025-08-20 08:28:29 +02:00
commit ee400fd23c
5 changed files with 631 additions and 0 deletions

59
Program.cs Normal file
View File

@@ -0,0 +1,59 @@
using DependencyInjections;
List<IPayment> listOfPayment = new List<IPayment>()
{
new PayPalPayment(),
new CreditCardPayment()
};
foreach (var paymentMethod in listOfPayment)
{
paymentMethod.ProcessPayment(10);
}
List<IPrintable> listOfPrint = new List<IPrintable>()
{
new PrintInvoice(),
new PrintLetter(),
new PrintReport()
};
foreach (var printMethod in listOfPrint)
{
printMethod.Print();
}
List<IDriveable> driveables = new List<IDriveable>()
{
new Car("Mercedes"),
new Motorcycle("Harley Davidson")
};
foreach (var driveable in driveables)
{
driveable.Start();
}
List<IMakeSound> makeSounds = new List<IMakeSound>()
{
new Cat(),
new Dog(),
new Cow()
};
foreach (var animal in makeSounds)
{
animal.MakeSound();
}
List<IWeapon> weapons = new List<IWeapon>()
{
new Staff(),
new Bow(),
new Sword()
};
foreach (var weapon in weapons)
{
Console.WriteLine(weapon.Attack());
}