Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- class Workman
- {
- public Workman(string name, int staj) { _name = name; _staj = staj; }
- public string _name = "";
- private int _staj = 0;
- private int _zaplata = 0;
- public int Zaplata()
- {
- if (_staj < 5) _zaplata = 800;
- else if (_staj >= 5 && _staj <= 10) _zaplata = 1200;
- else _zaplata = ((_staj - 10) * 100) + 1200;
- return _zaplata;
- }
- public double Udrujki(int zaplata)
- {
- double udrujki = 0.0;
- udrujki += zaplata * 0.06;
- udrujki += zaplata * 0.1;
- return udrujki;
- }
- public double sumaZaPoluchavane()
- {
- return _zaplata - (_zaplata * 0.06) - (_zaplata * 0.1);
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("--- georgi ---");
- Workman georgi = new Workman("georgi", 6);
- Console.WriteLine(georgi.Zaplata());
- Console.WriteLine(georgi.Udrujki(georgi.Zaplata()));
- Console.WriteLine(georgi.sumaZaPoluchavane() + '\n');
- Console.WriteLine("--- mitko ---");
- Workman mitko = new Workman("mitko", 12);
- Console.WriteLine(mitko.Zaplata());
- Console.WriteLine(mitko.Udrujki(mitko.Zaplata()));
- Console.WriteLine(mitko.sumaZaPoluchavane());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment