Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Zadanie_klasy
- {
- class Program
- {
- static void Main(string[] args)
- {
- Wyswietl_dane A = new Wyswietl_dane();
- A.WczytajBokA();
- A.WczytajBokB();
- A.ObliczPole();
- Console.WriteLine(A.Wypisz());
- Console.ReadKey();
- }
- }
- class Czytaj_dane
- {
- protected int BokA = 2;
- protected int BokB = 2;
- public int WczytajBokA()
- {
- int.TryParse(Console.ReadLine(), out BokA);
- return BokA;
- }
- public int WczytajBokB()
- {
- int.TryParse(Console.ReadLine(), out BokB);
- return BokB;
- }
- }
- class Przetworz_dane : Czytaj_dane
- {
- protected int Powierzchnia;
- public int ObliczPole()
- {
- Powierzchnia = BokA * BokB;
- return Powierzchnia;
- }
- }
- class Wyswietl_dane : Przetworz_dane
- {
- public int Wypisz()
- {
- return Powierzchnia;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement