Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 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 ConsoleApp4
  8. {
  9. class Program
  10. {
  11.  
  12. static string[] niz = new string[] {"Coca-Cola" ,"Smoki" ,"Sladoled" };
  13. static float status = 0;
  14. static int jedan = 0;
  15. static int dva = 1;
  16. static int tri = 2;
  17. static int cetri = 3;
  18. static int pet = 4;
  19. static int jedanZaMenu = 1;
  20. static int dvaZaMenu = 2;
  21. static int triZaMenu = 3;
  22. static void Main(string[] args)
  23. {
  24.  
  25.  
  26. while (true)
  27. {
  28. MainMenu();
  29.  
  30. }
  31.  
  32.  
  33. }
  34. static void MainMenu()
  35. {
  36. Console.WriteLine("===============================");
  37. jedan++;
  38. Console.WriteLine( jedan + ".............Stanje");
  39. dva++;
  40. Console.WriteLine(dva + ".............Kupovina");
  41. tri++;
  42. Console.WriteLine(tri + ".............Skladište");
  43. cetri++;
  44. Console.WriteLine(cetri + ".............Administracija");
  45. pet++;
  46. Console.WriteLine(pet + ".............Izlaz");
  47. Console.WriteLine("================================");
  48. string line = Console.ReadLine();
  49. int command = int.Parse(line);
  50. if(command == 1)
  51. {
  52. Stanje();
  53. }
  54. if(command == 2)
  55. {
  56. ShopMeni();
  57. }
  58.  
  59. return;
  60. }
  61. static void ShopMeni()
  62. {
  63. Console.Clear();
  64. Console.WriteLine("=================================");
  65. Console.WriteLine(jedanZaMenu + "................Coca-Cola");
  66. Console.WriteLine(dvaZaMenu + "..................Smoki");
  67. Console.WriteLine(triZaMenu + "..................Sladoled");
  68. Console.WriteLine("=================================");
  69. BuyItem(1);
  70.  
  71. return;
  72. }
  73. static void Stanje()
  74. {
  75. Console.Clear();
  76. Console.WriteLine(status);
  77. return;
  78. }
  79. static bool BuyItem(float Float)
  80. {
  81. string ColaSmokiSladoled = Console.ReadLine();
  82. int colasmokisladoled = int.Parse(ColaSmokiSladoled);
  83. if(colasmokisladoled == 1)
  84. {
  85. status += 1;
  86.  
  87. }
  88. else if(colasmokisladoled == 2)
  89. {
  90. status += 0.50f;
  91. }
  92. else if(colasmokisladoled == 3)
  93. {
  94. status += 1;
  95. }
  96.  
  97. return true;
  98. }
  99.  
  100. }
  101. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement