Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.39 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 BankingTransaction
  8. {
  9. class Program
  10. {
  11. public static void Main(string[] args)
  12. {
  13. int amount = 1000000, deposit, withdraw, payment, al1, al2, al3,al4;
  14. int bank_acct;
  15. int password;
  16. int ebills = 8000;
  17. int wbills = 8000;
  18. int sbills = 8000;
  19. int ccard = 8000;
  20.  
  21. Console.WriteLine("Enter your account number:");
  22. bank_acct = Convert.ToInt32(Console.ReadLine());
  23. Console.WriteLine("Enter your password: ");
  24. password = Convert.ToInt32(Console.ReadLine());
  25.  
  26. Console.WriteLine("1.BALANCE INQUIRY:\n");
  27. Console.WriteLine("2.DEPOSIT:");
  28. Console.WriteLine("3.WITHDRAW:");
  29. Console.WriteLine("4.PAYBILLS:");
  30. Console.WriteLine("5.EXIT\n");
  31. while(true) {
  32.  
  33. int a = int.Parse(Console.ReadLine());
  34. Console.WriteLine("-----------------------------");
  35.  
  36.  
  37. switch (a) {
  38.  
  39. case 1:
  40. Console.WriteLine("Your balance inquiry is: {0}", +amount);
  41. break;
  42.  
  43. case 2:
  44. {
  45. Console.WriteLine("Enter amount to deposit:");
  46. deposit = int.Parse(Console.ReadLine());
  47. amount = amount + deposit;
  48. Console.WriteLine("Your balance is {0}", + amount);
  49. }break;
  50.  
  51. case 3:
  52. {
  53. Console.WriteLine("Enter amount to withdraw:");
  54. withdraw = int.Parse(Console.ReadLine());
  55. amount = amount - withdraw;
  56. Console.WriteLine("Your balance is {0}", +amount);
  57. } break;
  58.  
  59.  
  60. case 4:
  61. Console.WriteLine("Choose bills to pay");
  62. Console.WriteLine("1. Electric Bill:");
  63. Console.WriteLine("2. Water Bill:");
  64. Console.WriteLine("3. School Fees:");
  65. Console.WriteLine("4. Credit Card:");
  66. int p = int.Parse(Console.ReadLine());
  67. Console.WriteLine("-----------------------------");
  68.  
  69. switch (p)
  70. {
  71.  
  72. case 1:
  73. Console.WriteLine("Your electric bills is {0}", ebills);
  74. Console.WriteLine("Enter amount to pay:");
  75. payment = int.Parse(Console.ReadLine());
  76. Console.WriteLine("Your payment has been successfully transacted");
  77. al1 = ebills - payment;
  78. Console.WriteLine("The payment left is: {0}", al1);
  79. break;
  80.  
  81. case 2:
  82. Console.WriteLine("Your water bills is {0}", wbills);
  83. Console.WriteLine("Enter amount to pay:");
  84. payment = int.Parse(Console.ReadLine());
  85. Console.WriteLine("Your payment has been successfully transacted");
  86. al2 = wbills - payment;
  87. Console.WriteLine("The payment left is: {0}", al2);
  88. break;
  89.  
  90. case 3:
  91. Console.WriteLine("Your school bills is {0}", sbills);
  92. Console.WriteLine("Enter amount to pay:");
  93. payment = int.Parse(Console.ReadLine());
  94. Console.WriteLine("Your payment has been successfully transacted");
  95. al3 = sbills - payment;
  96. Console.WriteLine("The payment left is: {0}", al3);
  97. break;
  98.  
  99. case 4:
  100. Console.WriteLine("Your credit card is {0}", ccard);
  101. Console.WriteLine("Enter amount to pay:");
  102. payment = int.Parse(Console.ReadLine());
  103. Console.WriteLine("Your payment has been successfully transacted");
  104. al4 = ccard - payment;
  105. Console.WriteLine("The payment left is: {0}", al4);
  106. break;
  107.  
  108. }
  109. break;
  110.  
  111. case 5:
  112. {Console.WriteLine("Exit\n");
  113. }break;
  114.  
  115.  
  116. }
  117. }
  118. }
  119. }
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement