Advertisement
sowamaciej

Untitled

Jul 3rd, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp1
  4. {
  5. class Echo
  6. {
  7. string napis;
  8. public void WczytajNapis()
  9. {
  10. Console.Write("Podaj napis: ");
  11. napis = Console.ReadLine();
  12. }
  13. public void Napisz()
  14. {
  15. Console.WriteLine("Napisaล‚eล›: " + napis);
  16. }
  17. public string getNapis()
  18. {
  19. return napis;
  20. }
  21. }
  22. class Editor
  23. {
  24. Echo obiekt;
  25.  
  26. public Editor(Echo echo)
  27. {
  28. obiekt = echo;
  29. }
  30.  
  31. public void toLowerCase()
  32. {
  33. Console.WriteLine(obiekt.getNapis().ToLower());
  34. }
  35. public void wyswietlWKolorze(ConsoleColor color)
  36. {
  37. Console.ForegroundColor = color;
  38. Console.WriteLine(obiekt.getNapis().ToLower());
  39. Console.ResetColor();
  40. }
  41. }
  42. class Program
  43. {
  44. static void Main(string[] args)
  45. {
  46. Echo obiekt = new Echo();
  47. obiekt.WczytajNapis();
  48. obiekt.Napisz();
  49. Editor editor = new Editor(obiekt);
  50. editor.toLowerCase();
  51. editor.wyswietlWKolorze(ConsoleColor.Cyan);
  52. Console.ReadLine();
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement