Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- namespace SantosYgi_PerformanceTask
- {
- class Program
- {
- static void Main(string[] args)
- {
- String username = "ygisantos";
- String password = "ygi123pass";
- int bankBalance = 3000;
- int wallet = 10000;
- String userUsername;
- String userPassword;
- int userInput;
- int userInputDeposit;
- int userInputWithdraw;
- bool isContinue = false;
- do
- {
- do
- {
- if (isContinue == false)
- {
- Console.WriteLine("What is your username?");
- userUsername = Console.ReadLine();
- Console.WriteLine("What is your password?");
- userPassword = Console.ReadLine();
- if (userUsername == username && userPassword == password)
- {
- isContinue = true;
- }
- }
- } while (isContinue == false);
- do
- {
- Console.WriteLine("============================== \nYour Bank Balance is {0}" +
- " \nYour current money is {1}\n==============================", bankBalance, wallet);
- Console.WriteLine("What would you like to do?");
- Console.WriteLine("1: Deposit \n2: Withdraw");
- userInput = Convert.ToInt32(Console.ReadLine());
- if (userInput == 1)
- {
- Console.WriteLine("How much would you like to deposit?");
- userInputDeposit = Convert.ToInt32(Console.ReadLine());
- bankBalance += userInputDeposit;
- wallet -= userInputDeposit;
- }
- if (userInput == 2)
- {
- Console.WriteLine("How much would you like to withdraw?");
- userInputWithdraw = Convert.ToInt32(Console.ReadLine());
- bankBalance -= userInputWithdraw;
- wallet += userInputWithdraw;
- }
- } while (isContinue == true);
- } while (true);
- }
- }
- }
- //ygisantos
Add Comment
Please, Sign In to add comment