Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- class Echo
- {
- string napis;
- public void WczytajNapis()
- {
- Console.Write("Podaj napis: ");
- napis = Console.ReadLine();
- }
- public void Napisz()
- {
- Console.WriteLine("Napisaลeล: " + napis);
- }
- public string getNapis()
- {
- return napis;
- }
- }
- class Editor
- {
- Echo obiekt;
- public Editor(Echo echo)
- {
- obiekt = echo;
- }
- public void toLowerCase()
- {
- Console.WriteLine(obiekt.getNapis().ToLower());
- }
- public void wyswietlWKolorze(ConsoleColor color)
- {
- Console.ForegroundColor = color;
- Console.WriteLine(obiekt.getNapis().ToLower());
- Console.ResetColor();
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Echo obiekt = new Echo();
- obiekt.WczytajNapis();
- obiekt.Napisz();
- Editor editor = new Editor(obiekt);
- editor.toLowerCase();
- editor.wyswietlWKolorze(ConsoleColor.Cyan);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement