Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Avtoservice
- {
- public class Client
- {
- public int DesiredGear { get; }
- private int _money;
- private int _moneyToPay;
- public Client(int money, Random random)
- {
- _money = money;
- DesiredGear = random.Next(1, 11);
- }
- public bool CheckSolvency(Gear gear)
- {
- _moneyToPay = gear.PriceForItem + gear.PriceForAssembling;
- if (_money >= _moneyToPay)
- {
- return true;
- }
- else
- {
- _moneyToPay = 0;
- return false;
- }
- }
- public int Pay()
- {
- _money -= _moneyToPay;
- return _moneyToPay;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement