using System.Collections.Generic;
using System.Diagnostics.Eventing.Reader;
using System.Security.Principal;
using System.Threading.Tasks;
static void Main(string[] args)
Console.WriteLine("Make Your Bank Account! ");
Console.WriteLine("Enter A New Username: ");
string username = Console.ReadLine();
Console.WriteLine("Enter A Secure Password: ");
string password = Console.ReadLine();
Console.WriteLine("Enter the amount you want to deposit: ");
double money = double.Parse(Console.ReadLine());
BankAccount account = new BankAccount(username, password, money);
Console.WriteLine("Log in required: ");
public static void Tax(ref BankAccount account)
Console.WriteLine("10% of your account has been lost to tax! ");
public static void Menu(ref BankAccount account)
Console.WriteLine("What do you want to do now: \n[1] Deposit Money\n[2] Withdraw Money\n[3] Change Password\n[4] Show Balance\n[5] Exit\n");
if (int.TryParse(Console.ReadLine(), out int choice))
Console.WriteLine("How much do you want to deposit? ");
account.Deposit(double.Parse(Console.ReadLine()));
Console.WriteLine("How much do you want to withdraw? ");
account.Withdraw(double.Parse(Console.ReadLine()));
Console.WriteLine("Enter your new password, and old to verify it is you: \n");
account.Password = Console.ReadLine();
Console.WriteLine("Balance: " + account.Money);
Console.WriteLine("Bye Bye");
Console.WriteLine("Error, Exiting");
Console.WriteLine("Incorrect Input Try Again! ");
public string Name { get => name; set => name = value; }
public string Password { private get => password;
Console.WriteLine("What was your old password? ");
if (Console.ReadLine().Equals(password))
Console.WriteLine("Successful! ");
Console.WriteLine("Incorrect Password, Try to Recover Password.");
public double Money { get { LogIn(); return money; } private set => money = value; }
public BankAccount(string name, string password)
this.password = password;
public BankAccount(string name, string password, double money)
this.password = password;
Console.WriteLine("Enter Your Username: ");
string tempUsername = Console.ReadLine();
Console.WriteLine("Enter Your Password: ");
string tempPassword = Console.ReadLine();
if(tempUsername.Equals(name) && tempPassword.Equals(password))
Console.WriteLine("Log In Succesful");
Console.WriteLine("Log In Failed, Try Again");
public void Withdraw(double amount)
Console.WriteLine("Successful!");
Console.WriteLine("Balance Too Low");
public void Withdraw(int percentage)
money = money * (percentage*.1);
public void Deposit(double amount)
Console.WriteLine("Successful!");