//1. Stwórz klasę kalkulator, która pozwoli dodawać, odejmować, mnożyć i dzielić. //Jej dodatkową funkcjonalnością będzie metoda pokazLiczbyCalkowite, //która pozwoli pokazać liczby całkowite od 1 do wartości podanej jako argument metody. //Czyli pokazLiczbyCalkowite(10) pokaze liczby od 1 do 10 using System; namespace dzien2 { class Kalkulator { public int _x; public int _y; public int Dodawanie(int x, int y) { this._x = x; this._y = y; return x + y; } public int Odejmowanie(int x, int y) { this._x = x; this._y = y; return x - y; } public int Dzielenie(int x, int y) { this._x = x; this._y = y; return x / y; } public int Mnozenie(int x, int y) { this._x = x; this._y = y; return x * y; } public string PokazLiczbyCalkowite(int x) { if (x > 0 && x%2 == 0) { return "PARZYSTE"; } else { return "NIEPARZYSTE"; } } public string PokazLiczbyCalkowite10() { return "1,2,3,4,5,6,7,8,9,10"; } } class Program { static void Main(string[] args) { Kalkulator suma = new Kalkulator(); Console.WriteLine("Dodawanie liczb 2 i 2 = " + suma.Dodawanie(2,2)); Kalkulator odjemnik = new Kalkulator(); Console.WriteLine("Odejmowanie liczb 2 i 2 = " + odjemnik.Odejmowanie(2, 2)); Kalkulator dzielnik = new Kalkulator(); Console.WriteLine("Dzielenie liczb 2 i 2 = " + dzielnik.Dzielenie(2, 2)); Kalkulator powielacz = new Kalkulator(); Console.WriteLine("Mnozenie 2 i 2 = " + powielacz.Mnozenie(2, 2)); Kalkulator Calkowite = new Kalkulator(); Console.WriteLine("Podaj liczbe calkowite: "); int v = Convert.ToInt32( Console.ReadLine()); Console.WriteLine(Calkowite.PokazLiczbyCalkowite(v)); Kalkulator Kolejne = new Kalkulator(); Console.WriteLine(Kolejne.PokazLiczbyCalkowite10()); Console.ReadKey(); } } }