Homework folder added

This commit is contained in:
Digi
2024-01-07 16:02:16 +01:00
parent 1083d18459
commit db917cc4ba
24 changed files with 573 additions and 0 deletions

56
HF/20240107/feladat4.cs Normal file
View File

@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Zenelejatszo
{
class Dal
{
public string cim, eloado;
public string Cim
{
get { return this.cim; }
set { this.cim = value; }
}
public string Eloado
{
get { return this.eloado; }
set { this.eloado = value; }
}
public Dal(string cim, string eloado)
{
Cim = cim;
Eloado = eloado;
}
}
class MusicPlayer
{
public List<Dal> l = new List<Dal>();
public void Lejatszas()
{
foreach (Dal d in l)
{
Console.WriteLine($"A szám előadója: {d.Eloado}");
Console.WriteLine($"A szám címe: {d.Cim}");
}
}
}
class Program
{
static void Main(string[] args)
{
MusicPlayer mp = new MusicPlayer();
Dal song = new Dal("Mindig és soha", "Mikee Mykanic");
Dal song1 = new Dal("Szellemjárás", "Killakikitt");
mp.l.Add(song);
mp.l.Add(song1);
mp.Lejatszas();
}
}
}