using System.Collections.Generic;
public static List<string> history = new List<string>();
public static bool CheckIfLegit(int num)
if (num % 20 == 0 || num % 50 == 0)
public static void Withdraw(int with, Account u, string sWit)
DateTime time = DateTime.Now;
bool legit = CheckIfLegit(with);
Console.WriteLine("The withdrawal of " + with + " was successful.");
Console.WriteLine("Cash retrieved\n");
history.Add(time.ToString(format) + " Withdrawal : " + sWit);
Console.WriteLine("You can't withdraw that specific amount.");
public static void WithdrawMoney(int money) {
int[] bills = new int[6];
Console.WriteLine("You can't withdraw that");
for (bills[0] = 0; money >= 1000; bills[0]++)
for (bills[1] = 0; money >= 500; bills[1]++)
for (bills[2] = 0; money >= 200; bills[2]++)
for (bills[3] = 0; money > 100; bills[3]++)
for (bills[4] = 0; money > 50; bills[4]++)
for (bills[5] = 0; money > 20; bills[5]++)
for (int i = 0; i < bills.Length; i++)
Console.WriteLine(Convert.ToString(bills[0]) + "x" + "1000" + " bill(s)");
Console.WriteLine(Convert.ToString(bills[1]) + "x" + "500" + " bill(s)");
Console.WriteLine(Convert.ToString(bills[2]) + "x" + "200" + " bill(s)");
Console.WriteLine(Convert.ToString(bills[3]) + "x" + "100" + " bill(s)");
Console.WriteLine(Convert.ToString(bills[4]) + "x" + "50" + " bill(s)");
Console.WriteLine(Convert.ToString(bills[5]) + "x" + "20" + " bill(s)");
public static void Deposit(int dep, Account u, string sDep)
DateTime time = DateTime.Now;
bool legit = CheckIfLegit(dep);
Console.WriteLine("The deposit of " + dep + " was successful.");
history.Add(time.ToString(format) + " Deposit : " + sDep);
Console.WriteLine("You can't deposit that specific amount.");
public static void Main(string[] args)
Console.WriteLine("Hello! This is the log-in screen, please enter your credentials!");
Console.WriteLine("(Just enter your name)");
string nameU = Console.ReadLine();
Account user = new Account(nameU);
Console.WriteLine("Hello and welcome to BankBank!");
Console.WriteLine("1: Deposit");
Console.WriteLine("2: Withdrawl");
Console.WriteLine("3: Account Statement");
Console.WriteLine("4: Log Out");
Console.WriteLine("Your current balance is: " + user.balance);
int index = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter amount to be deposited");
string deposit = Console.ReadLine();
int nDeposit = Convert.ToInt32(deposit);
Deposit(nDeposit, user, deposit);
Console.WriteLine("Enter amount to withdraw");
string withdrawal = Console.ReadLine();
int nWithdrawal = Convert.ToInt32(withdrawal);
Withdraw(nWithdrawal, user, withdrawal);
Console.WriteLine("Account user: " + user._name);
Console.WriteLine("Your balance is : " + user.balance);
Console.WriteLine("=====HISTORY=====");
foreach (string action in history)
Console.WriteLine(action);
Console.WriteLine("Thank you for your visit!");
Console.WriteLine("That not a valid choice fam");
Console.WriteLine("Your account balance is: {}");
public int balance = 5000;
public Account(string name)