Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Zad1
  8. {
  9. public class Racun
  10. {
  11. private int _stanje;
  12. private string _brojracuna;
  13. private Vlasnikcs _vlasnik;
  14.  
  15. public int Stanje
  16. {
  17. get
  18. {
  19. return _stanje;
  20. }
  21. }
  22.  
  23. public string Brojracuna
  24. {
  25. get
  26. {
  27. return _brojracuna;
  28. }
  29. set
  30. {
  31. _brojracuna = value;
  32. }
  33. }
  34.  
  35. public Vlasnikcs Vlasnik
  36. {
  37. get
  38. {
  39. return _vlasnik;
  40. }
  41. set
  42. {
  43. _vlasnik = value;
  44. }
  45. }
  46.  
  47. public Racun()
  48. {
  49. _vlasnik = new Vlasnikcs();
  50. }
  51.  
  52. public Racun(int stanje):this()
  53. {
  54. _stanje = stanje;
  55. }
  56.  
  57. public void Uplata(int iznos)
  58. {
  59. _stanje += iznos;
  60.  
  61. }
  62.  
  63. public void Isplata(int iznos)
  64. {
  65. if (iznos <= _stanje)
  66. {
  67. _stanje -= iznos;
  68. }
  69. else
  70. {
  71. Console.WriteLine("Nemate dovoljno sredstava");
  72. }
  73. }
  74.  
  75.  
  76.  
  77. }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement