Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Kolos
- {
- class Program
- {
- static void Main(string[] args)
- {
- while (true)
- {
- try
- {
- Player player = new Player();
- Pop pop = new Pop("1", "1", "1");
- player.DodajPiosenke(pop);
- Alt alt = new Alt("2", "2", "2");
- player.DodajPiosenke(alt);
- Rock rock = new Rock("ss", "ss", "ss");
- player.DodajPiosenke(rock);
- Jazz jazz = new Jazz("ok", "ok", "ok");
- player.DodajPiosenke(jazz);
- player.WyswietlPiosenki();
- string[] menu = { "Dodawanie utworu", "Usuwanie utworu", "Wyświetl odtwarzacz"};
- for (int i = 0; i < menu.Length; i++)
- {
- Console.WriteLine((i + 1) + "." + menu[i]);
- }
- string caseSwitch1 = (Console.ReadLine());
- switch (caseSwitch1)
- {
- case "Dodaj":
- Console.WriteLine("Podaj nazwe utworu:");
- string utwor = (Console.ReadLine());
- Console.WriteLine("Podaj nazwe wykonawcy:");
- string wykonawca = (Console.ReadLine());
- Console.WriteLine();
- Console.WriteLine("Wybierz gatunek muzyki danego utworu:");
- string[] gatunek = { "Alternatywa", "Jazz", "Pop", "Rock", "Wyjście" };
- for (int i = 0; i < gatunek.Length; i++)
- {
- Console.WriteLine((i + 1) + "." + gatunek[i]);
- }
- int caseSwitch = int.Parse(Console.ReadLine());
- switch (caseSwitch)
- {
- case 1:
- Alt alt1 = new Alt(utwor, wykonawca, gatunek[0]);
- player.DodajPiosenke(alt1);
- break;
- case 2:
- Jazz jazz1 = new Jazz(utwor, wykonawca, gatunek[1]);
- player.DodajPiosenke(jazz1);
- break;
- case 3:
- Pop pop1 = new Pop(utwor, wykonawca, gatunek[2]);
- player.DodajPiosenke(pop1);
- pop1.Play();
- break;
- case 4:
- Rock rock1 = new Rock(utwor, wykonawca, gatunek[3]);
- player.DodajPiosenke(rock1);
- rock1.Play();
- break;
- case 5:
- Environment.Exit(1);
- break;
- default:
- Console.WriteLine();
- break;
- }
- case "Usuń":
- Console.WriteLine("usuwanie");
- break;
- case "Wyświetl":
- player.WyswietlPiosenki();
- break;
- }
- }
- catch (FormatException)
- {
- Console.Clear();
- Console.WriteLine("Została wprowadzona błędna wartość");
- }
- catch (ArgumentOutOfRangeException)
- { Console.WriteLine("Została wprowadzona za duża wartość "); }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement