Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace HOA1
- {
- class Program
- {
- static void Main(string[] args)
- {
- string user, password;
- Console.Write("Enter acct name: ");
- user = Console.ReadLine();
- Console.Write("Enter pin: ");
- password = Console.ReadLine();
- if (user == "user" && password == "1234")
- {
- int balance, choice;
- Console.WriteLine("---------------------------------");
- Console.WriteLine("Welcome user!");
- Console.Write("Set your initial balance: ");
- balance = int.Parse(Console.ReadLine());
- Console.WriteLine("Balance: Php " + balance);
- Console.WriteLine("---------------------------------");
- Console.WriteLine("Choose an option: ");
- Console.WriteLine("1 - Deposit");
- Console.WriteLine("2 - Withdraw");
- Console.Write("Enter choice: ");
- choice = int.Parse(Console.ReadLine());
- if (choice == 1)
- {
- int money_add;
- Console.WriteLine("---------------------------------");
- Console.Write("How much would you want to deposit?: ");
- money_add = int.Parse(Console.ReadLine());
- balance += money_add;
- Console.WriteLine("Your money now is Php" + balance);
- Console.ReadKey();
- Console.WriteLine("---------------------------------");
- }
- else if (choice == 2)
- {
- int withdraw;
- Console.WriteLine("---------------------------------");
- Console.Write("How much would you want to withdraw?: ");
- withdraw = int.Parse(Console.ReadLine());
- if (withdraw <= balance)
- {
- balance -= withdraw;
- Console.WriteLine("Your updated balance is: Php " + balance);
- Console.ReadKey();
- }
- else
- {
- Console.WriteLine("Insufficient funds. . .");
- }
- Console.WriteLine("---------------------------------");
- }
- else
- {
- Console.WriteLine("Invalid transaction!. . .");
- }
- Console.WriteLine("Your balance is: Php " + balance);
- Console.WriteLine("Thank you for banking with us!");
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement