Guest User

Untitled

a guest
Apr 25th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp6
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string imie;
  14. do
  15. {
  16. Console.WriteLine("Podaj imię ");
  17. imie = Console.ReadLine();
  18. } while (imie == String.Empty);
  19.  
  20. string nazwisko;
  21. do
  22. {
  23. Console.WriteLine("Podaj Nazwisko ");
  24. nazwisko = Console.ReadLine();
  25. } while (nazwisko == String.Empty);
  26.  
  27. Console.WriteLine("podaj tytul ksiazki:");
  28. string ksiazka = Console.ReadLine();
  29.  
  30. Console.WriteLine("Podaj date wypozyczenia: \n Rok:");
  31. int rok = int.Parse(Console.ReadLine());
  32. Console.WriteLine("Podaj miesiąc");
  33. int miesiac = int.Parse(Console.ReadLine());
  34. Console.WriteLine("Dzien");
  35. int dzien = int.Parse(Console.ReadLine());
  36.  
  37. Czytelnik c =new Czytelnik(imie, nazwisko, new Ksiazka(ksiazka, new DateTime(rok, miesiac, dzien)));
  38.  
  39. Console.WriteLine($"Imie: {c.Imie} \n Nazwisko: {c.Nazwisko}");
  40. Console.WriteLine($"Tytuł: {c.KKsiazka.Tytul}, Data wypozyczenia: {c.KKsiazka.Data.ToString("yyyy-MMMM-dd")}");
  41.  
  42.  
  43. Console.ReadKey();
  44.  
  45. }
  46. }
  47. }
Add Comment
Please, Sign In to add comment