using System; using System.Collections.Generic; using System.Text; namespace impbank { delegate Double account(Double bal); delegate void withdrawevent(); class wevent { public event withdrawevent less_bal; public void lessbalance() { less_bal(); } }; interface IBank { void display(int ano, string name, double bal); void display1(int ano, string name, double bal); } class details { private int acno; private String cname; private String address; private String desig; private int phoneno; private Double balance; public double interest; public double amount; public double iamount; public details() { } public details(int ano, String name, String addr, int pno, Double bal) { acno = ano; cname = name; address = addr; phoneno = pno; balance = bal; } public int bank_ano { get { return acno; } set { acno = value; } } public String bank_name { get { return cname; } set { cname = value; } } public String bank_address { get { return address; } set { address = value; } } public String bank_desig { get { return desig; } set { desig = value; } } public int bank_phno { get { return phoneno; } set { phoneno = value; } } public Double bank_bal { get { return balance; } set { balance = value; } } }; sealed class cal : details, IBank { public cal() { }
public cal(int ano, String name, String addr, int pno, Double bal) : base(ano, name, addr, pno, bal) { } public Double deposit(Double bal) { Double damt = 0.00d; dep: Console.ForegroundColor = ConsoleColor.Yellow; System.Threading.Thread.Sleep(1000); Console.WriteLine(); Console.WriteLine(); Console.Write("\t\t\tEnter the amount to deposit : "); string str = Console.ReadLine(); double Num; bool isNum = double.TryParse(str, out Num); if (isNum) { damt = Convert.ToDouble(str); amount = damt; iamount = bal; interest = damt * 0.05; bank_bal = bal + damt + interest; } else { Console.ForegroundColor = ConsoleColor.Red; System.Threading.Thread.Sleep(1000); Console.Beep(); Console.WriteLine(); Console.WriteLine("\t\t\tEnter the amount properly"); Console.ReadKey(); goto dep; } return bank_bal; } static void wevent_handle() { Console.ForegroundColor = ConsoleColor.Red; System.Threading.Thread.Sleep(1000); Console.Beep(); Console.WriteLine(); Console.WriteLine("\t\t\tThe minimum balance should be Rs.500"); Console.ReadKey(); } public Double withdraw(Double bal) { Double wamt = 0.00d; wdraw: Console.ForegroundColor = ConsoleColor.Yellow; System.Threading.Thread.Sleep(1000); Console.WriteLine(); Console.WriteLine(); Console.Write("\t\t\tEnter the amount to withdraw : "); string str = Console.ReadLine(); double Num; bool isNum = double.TryParse(str, out Num); if (isNum) { wamt = Convert.ToDouble(str); if ((bal - wamt) >= 500)
{
amount = wamt; iamount = bal; interest = bal * 0.01; bank_bal = (bal - wamt) + interest;
} else {
wevent w = new wevent(); w.less_bal += wevent_handle; w.lessbalance(); goto wdraw; }
} else {
Console.ForegroundColor = ConsoleColor.Magenta; System.Threading.Thread.Sleep(1000); Console.Beep(); Console.WriteLine(); Console.WriteLine("\t\t\tEnter the amount properly"); Console.ReadKey(); goto wdraw; } return bank_bal; } public void display(int ano, string name, double bal) { Console.ForegroundColor = ConsoleColor.Green; System.Threading.Thread.Sleep(1000); Console.WriteLine("\t---------------------------------------------------------------------"); Console.WriteLine("\t\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\t\t\t\t\tKANARA BANK\t\t\t\t "); Console.WriteLine("\t\t\t\t\t===========\t\t\t\t "); Console.WriteLine("\t\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\t---------------------------------------------------------------------"); Console.WriteLine("\t\t\t\t\t\t\t" + DateTime.Now + " "); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t---------------------------------------------------------------------"); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\t Acc. No.\tName\tExisting Deposit\tInterest\tBalance "); Console.WriteLine("\t \t \tBalance Amount\t\t\t\t "); Console.WriteLine("\t\t\t\t\t\t\t\t\t\t "); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t---------------------------------------------------------------------"); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\t KA" + ano + "\t\t" + name + "\t" + iamount + "\t " + amount + "\t" + interest + "\t\t" + bal + "\t "); System.Threading.Thread.Sleep(1000);
} public void display1(int ano, string name, double bal) { Console.ForegroundColor = ConsoleColor.Blue; System.Threading.Thread.Sleep(1000); Console.WriteLine("\t----------------------------------------------------------------------"); Console.WriteLine("\t\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\t\t\t\t\tKANARA BANK\t\t\t\t "); Console.WriteLine("\t\t\t\t\t===========\t\t\t\t "); Console.WriteLine("\t\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\t---------------------------------------------------------------------"); Console.WriteLine("\t\t\t\t\t\t\t" + DateTime.Now + " |"); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t---------------------------------------------------------------------"); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\t Acc. No.\tName\tExisting Withdraw\tInterest\tBalance "); Console.WriteLine("\t \t \t \tBalance Amount\t\t\t\t "); Console.WriteLine("\t\t\t\t\t\t\t\t\t\t "); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t---------------------------------------------------------------------"); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\tKA" + ano + "\t\t" + name + "\t" + iamount + "\t " + amount + "\t\t" + interest + "\t\t" + bal + "\t "); System.Threading.Thread.Sleep(1000);
"";
} }; class Bank { static void Main(string[] args) { cal c = new cal(); cal[] c1 = new cal[10]; bool ch2 = true; string ch = "", name = "", addr = "", ano = "", des = "", ch1 = Double bal = 0.0d, amt = 0.0d; int i, pno = 0, no = 100, k = 0; Boolean find = false; String nam = ""; i = 0; account a; Console.Clear(); Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine("\n\t\t\t\t\tKANARA BANK"); Console.WriteLine("\t\t\t\t\t================"); Console.ResetColor();
do { try { Console.ForegroundColor = ConsoleColor.DarkGreen; Console.WriteLine(); Console.WriteLine(); Console.WriteLine("\t\t--------------------------Menu------------------------------"); Console.WriteLine("\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\t\t\t Create Account (a)\t\t\t\t "); Console.WriteLine("\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\t\t\t Deposit (d)\t\t\t\t\t "); Console.WriteLine("\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\t\t\t Withdraw (w)\t\t\t\t\t "); Console.WriteLine("\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\t\t\t View Details (v)\t |"); Console.WriteLine("\t\t\t\t\t\t\t\t\t "); ");
Console.WriteLine("\t\t\t Updating Details (u)\t\t\t\t Console.WriteLine("\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\t\t\t Delete Account (da)\t\t\t\t
");
Console.WriteLine("\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\t\t\t Exit (e)\t\t\t\t\t "); Console.WriteLine("\t\t\t\t\t\t\t\t\t "); Console.WriteLine("\t\t------------------------------------------------------------"); Console.WriteLine(); Console.ResetColor(); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write("\t\tEnter your choice : "); ch = Console.ReadLine().Trim().ToLower(); Console.WriteLine(ch); Console.ResetColor(); Console.Clear(); Console.WriteLine(); switch (ch) { case "a": Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine("\t\t\t\t Account Creation"); Console.WriteLine("\t\t\t\t ****************"); Console.WriteLine(); Console.ResetColor(); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write("\t\t\tEnter your name : "); name = Console.ReadLine(); Console.WriteLine(); Console.Write("\t\t\tEnter your address : "); addr = Console.ReadLine(); Console.WriteLine(); Console.Write("\t\t\tEnter your designation : "); des = Console.ReadLine(); Console.WriteLine(); Console.Write("\t\t\tEnter your contact no. : "); pno = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(); do { try { Console.ForegroundColor = ConsoleColor.Cyan; deposit : ");
should be atleast Rs.500");
ConsoleColor.Red; Console.Beep(); e.Message);
KA" + c1[i].bank_ano);
Created ============");
Console.Write("\t\t\tEnter amount to bal = Double.Parse(Console.ReadLine()); Console.WriteLine(); if (bal < 500) { throw new Exception("Initial deposit } } catch (Exception e) { Console.ForegroundColor = System.Threading.Thread.Sleep(100); Console.WriteLine("\t\tException : " + Console.WriteLine(); Console.ReadKey(); } } while (bal < 500); c1[i] = new cal(no, name, addr, pno, bal); System.Threading.Thread.Sleep(100); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("\t\t\tYour Account number is System.Threading.Thread.Sleep(1000); Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine(); Console.WriteLine(); Console.WriteLine("\t\t============ Account Console.WriteLine(); Console.WriteLine(); System.Threading.Thread.Sleep(1000); Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine("\t\t\t\t\t " +
DateTime.Now);
System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t-------------------------------------------------------"); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t\tAcc. No. \tName \tBalance"); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t-------------------------------------------------------"); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t\tKA" + c1[i].bank_ano + "\t\t" + c1[i].bank_name + "\t\t" + c1[i].bank_bal); System.Threading.Thread.Sleep(1000);
Console.WriteLine("\t\t-------------------------------------------------------"); no++; i++; Console.ReadKey(); break; case "d": a = c.deposit; find = false; amt = 0.0d; nam = ""; k = 0; Console.Clear(); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("\t\t\t\tDeposit"); Console.WriteLine("\t\t\t\t******"); Console.WriteLine(); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write("\t\tEnter the account number : "); ano = Console.ReadLine(); if (ano.Length == 5) { if (ano.StartsWith("KA")) { string s = ano.Substring(2, 3); int n = Convert.ToInt32(s); for (k = 0; k < i; k++) { if (c1[k].bank_ano == n) { find = true; amt = c1[k].bank_bal; nam = c1[k].bank_name; break; } else find = false; } if (find == true) { Console.Clear(); Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine(); Console.WriteLine(); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t============= Deposit ============="); Console.WriteLine(); Console.WriteLine(); System.Threading.Thread.Sleep(1000); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("\t\tNAME :" + nam + ","); Console.WriteLine(); Console.WriteLine();
Console.ForegroundColor =
ConsoleColor.Magenta;
System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t\tBalance : " + amt);
c1[k].bank_bal = a(amt); Console.WriteLine();
Console.WriteLine();
Console.ForegroundColor =
ConsoleColor.Cyan;
System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t========== Amount Deposited =========");
Console.WriteLine();
Console.WriteLine();
System.Threading.Thread.Sleep(1000); Console.ForegroundColor =
ConsoleColor.Magenta;
c.display(c1[k].bank_ano,
c1[k].bank_name, c1[k].bank_bal); } else {
Console.WriteLine(); Console.ForegroundColor =
ConsoleColor.Red;
Console.WriteLine("\t\tInvalid account number");
} }
} Console.ReadKey(); break; case "w": a = c.withdraw; find = false; amt = 0.0d; nam = ""; k = 0; Console.Clear(); Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine("\t\t\t\tWithdraw"); Console.WriteLine("\t\t\t\t********"); Console.WriteLine(); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write("\t\tEnter the account number : "); ano = Console.ReadLine(); if (ano.Length == 5) { if (ano.StartsWith("KA")) { string s = ano.Substring(2, 3); int n = Convert.ToInt32(s); for (k = 0; k < i; k++)
{
ConsoleColor.Magenta;
if (c1[k].bank_ano == n) { find = true; amt = c1[k].bank_bal; nam = c1[k].bank_name; break; } else find = false;
} if (find == true) { Console.Clear(); Console.ForegroundColor = Console.WriteLine();
Console.WriteLine();
System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t=========== Withdraw
===========");
Console.WriteLine();
Console.WriteLine();
System.Threading.Thread.Sleep(1000); Console.ForegroundColor =
ConsoleColor.Yellow;
Console.WriteLine("\t\tNAME:" + nam +
",");
Console.WriteLine();
Console.WriteLine();
Console.ForegroundColor =
ConsoleColor.Cyan;
System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t\tBalance : " + amt);
c1[k].bank_bal = a(amt); Console.WriteLine();
Console.WriteLine();
Console.ForegroundColor =
ConsoleColor.Cyan;
System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t===== Amount Withdrawn =====");
Console.WriteLine();
Console.WriteLine();
System.Threading.Thread.Sleep(1000); Console.ForegroundColor =
ConsoleColor.Cyan;
c.display1(c1[k].bank_ano,
c1[k].bank_name, c1[k].bank_bal); } else { ConsoleColor.Red;
Console.WriteLine(); Console.ForegroundColor = Console.Beep();
Console.WriteLine("\t\tInvalid
account number"); }
}
} Console.ReadKey(); break; case "v": Console.Clear(); Console.WriteLine(); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("\t\t--------------------------Menu------------------------------"); Console.WriteLine("\t\t\t\t\t\t\t\t"); Console.WriteLine("\t\t\t View Details of particular customer(p) "); Console.WriteLine("\t\t\t\t\t\t\t\t"); Console.WriteLine("\t\t\t View Details of all customers(ca) "); Console.WriteLine("\t\t\t\t\t\t\t\t"); Console.WriteLine("\t\t\t View Details of customers with balance <= 1000(l)"); Console.WriteLine("\t\t\t\t\t\t\t\t"); Console.WriteLine("\t\t\t View Details of customers with balance > 1000(g)"); Console.WriteLine("\t\t\t\t\t\t\t\t"); Console.WriteLine("\t\t------------------------------------------------------------"); Console.Write("\t\tEnter your choice : "); ch1 = Console.ReadLine().Trim().ToLower(); Console.WriteLine(ch1); Console.ResetColor(); Console.Clear(); Console.WriteLine(); if (ch2 == true) { switch (ch1) { case "p": Console.WriteLine("\t\t\t Details of particular Customer"); Console.WriteLine("\t\t\t ******************************"); Console.WriteLine(); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write("\t\tEnter the account number : "); ano = Console.ReadLine(); if (ano.Length == 5) { if (ano.StartsWith("KA")) { string s = ano.Substring(2, 3); int n = Convert.ToInt32(s); for (k = 0; k < i; k++)
{
c1[k].bank_address;
if (c1[k].bank_ano == n) { find = true; amt = c1[k].bank_bal; nam = c1[k].bank_name; addr = pno = c1[k].bank_phno; break; } else
find = false; } if (find == true) { Console.ForegroundColor =
ConsoleColor.Yellow;
Console.WriteLine();
Console.WriteLine();
System.Threading.Thread.S
leep(1000); ====== Details of " + nam + " ========");
Console.WriteLine("\t\t== Console.WriteLine();
Console.WriteLine();
Console.ForegroundColor =
ConsoleColor.White;
System.Threading.Thread.S
leep(1000);
Console.WriteLine("\t\t\t \t\t\t\t\t\t\t
");
Console.WriteLine("\t\t\t
\t\tKANARA BANK\t\t\t\t \t\t==*==*==\t\t\t\t \t\t\t\t\t\t\t
");
\t\t\t\t\t\t\t
");
");
");
Console.WriteLine("\t\t\t Console.WriteLine("\t\t\t
Console.WriteLine("\t--------------------------------------------------------------"); Console.WriteLine("\t\t\t \t\t\t\t" + DateTime.Now + " "); System.Threading.Thread.S leep(1000); Console.WriteLine("\t--------------------------------------------------------------"); System.Threading.Thread.S leep(1000); Console.WriteLine("\t\t\t \t\t\t\t\t\t\t "); Console.WriteLine("\t Acc. No.\tName\tAddress\t ContactNo.\t Balance\t "); Console.WriteLine("\t\t\t
System.Threading.Thread.S
leep(1000);
Console.WriteLine("\t-------------------------------------------------------------"); System.Threading.Thread.S leep(1000); Console.WriteLine("\t\t\t \t\t\t\t\t\t\t "); Console.WriteLine("\t KA" + ano + "\t\t" + nam + "\t" + addr + "\t \t" + pno + "\t \t" + amt + "\t "); System.Threading.Thread.S leep(1000); Console.WriteLine("\t\t\t \t\t\t\t\t\t\t "); } else { Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Red;
Console.Beep(); Console.WriteLine("\t\tIn
valid account number"); }
}
} Console.ReadKey(); break; case "ca": Console.Clear(); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine(); Details of All Customers ========="); Console.WriteLine(); ConsoleColor.White;
Console.WriteLine(); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t======== Console.WriteLine(); Console.ForegroundColor = System.Threading.Thread.Sleep(1000);
\t
Console.WriteLine("\t\t\t\t\t\t\t\t\t
");
BANK\t\t\t\t \t\t\t\t \t
");
");
");
Console.WriteLine("\t\t\t\t\tKANARA Console.WriteLine("\t\t\t\t\t==*==*== Console.WriteLine("\t\t\t\t\t\t\t\t\t
Console.WriteLine("\t----------------------------------------------------------------");
DateTime.Now + "
");
Console.WriteLine("\t\t\t\t\t\t\t" +
System.Threading.Thread.Sleep(1000); Console.WriteLine("\t----------------------------------------------------------------"); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t\t\t\t\t\t\t\t \t "); Console.WriteLine("\t Acc. No.\tName\tAddress\t Contact No.\tBalance\t "); Console.WriteLine("\t\t\t\t\t\t\t\t\t \t
");
System.Threading.Thread.Sleep(1000); Console.WriteLine("\t--------------------------------------------------------------"); System.Threading.Thread.Sleep(1000); for (int j = 0; j < i; j++) { Console.WriteLine("\t\t\t\t\t\t\t \t\t\t "); Console.WriteLine("\t KA" + c1[j].bank_ano + "\t\t" + c1[j].bank_name + "\t" + c1[j].bank_address + "\t " + c1[j].bank_phno + "\t " + c1[j].bank_bal + "\t\t "); } System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t\t\t\t\t\t\t\t \t "); Console.ReadKey(); break; case "l": int l = 0; Console.Clear(); Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine();
Console.WriteLine();
System.Threading.Thread.Sleep(1000); Console.WriteLine("\t== Details of Customers having balance <= Rs.1000 =="); Console.WriteLine(); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.White; System.Threading.Thread.Sleep(1000); \t
Console.WriteLine("\t\t\t\t\t\t\t\t\t
");
BANK\t\t\t\t \t\t\t\t \t
");
");
");
Console.WriteLine("\t\t\t\t\tKANARA Console.WriteLine("\t\t\t\t\t==*==*== Console.WriteLine("\t\t\t\t\t\t\t\t\t
Console.WriteLine("\t-----------------------------------------------------------"); Console.WriteLine("\t\t\t\t\t\t\t" + DateTime.Now + " "); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t-------------------------------------------------------"); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t\t\t\t\t\t\t\t \t "); Console.WriteLine("\t\t Acc. No.\tName\tAddress\t Contact No.\t Balance\t "); Console.WriteLine("\t\t\t\t\t\t\t\t\t \t
");
System.Threading.Thread.Sleep(1000); Console.WriteLine("\t--------------------------------------------------------"); System.Threading.Thread.Sleep(1000); for (int j = 0; j < i; j++) { if (c1[j].bank_bal <= 1000) { l = l + 1; Console.WriteLine("\t\t\t\t\t \t\t\t\t\t "); Console.WriteLine("\t KA" + c1[j].bank_ano + "\t\t" + c1[j].bank_name + "\t" + c1[j].bank_address + "\t " + c1[j].bank_phno + "\t " + c1[j].bank_bal + "\t\t "); } } if (l == 0) Console.WriteLine("\t\t\tNo customer is having balance <= Rs.1000\t\t "); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t\t\t\t\t\t\t\t \t "); Console.ReadKey(); break; case "g": int g = 0; Console.Clear(); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine(); Customers having balance > Rs.1000 ="); Console.WriteLine(); ConsoleColor.White;
Console.WriteLine(); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t= Details of Console.WriteLine(); Console.ForegroundColor = System.Threading.Thread.Sleep(1000);
Console.WriteLine("\t\t\t\t\t\t\t\t\t \t
");
Console.WriteLine("\t\t\t\t\tKANARA
BANK\t\t\t\t \t\t\t\t \t
");
\t
");
");
Console.WriteLine("\t\t\t\t\t==*==*==
");
Console.WriteLine("\t\t\t\t\t\t\t\t\t
Console.WriteLine("\t---------------------------------------------------------"); Console.WriteLine("\t\t\t\t\t\t\t" + DateTime.Now + " "); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t---------------------------------------------------------"); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t\t\t\t\t\t\t\t \t "); Console.WriteLine("\t Acc. No.\tName\tAddress\t Contact No.\t Balance\t "); Console.WriteLine("\t\t\t\t\t\t\t\t\t
System.Threading.Thread.Sleep(1000); Console.WriteLine("\t---------------------------------------------------------"); System.Threading.Thread.Sleep(1000); for (int j = 0; j < i; j++) { if (c1[j].bank_bal > 1000) { g = g + 1; Console.WriteLine("\t\t\t\t\t \t\t\t\t\t "); Console.WriteLine("\t KA" + c1[j].bank_ano + "\t\t" + c1[j].bank_name + "\t" + c1[j].bank_address + "\t" + c1[j].bank_phno + "\t " + c1[j].bank_bal + "\t\t "); } } if (g == 0) Console.WriteLine("\t\t\tNo customer is having balance greater than Rs.1000\t |"); System.Threading.Thread.Sleep(1000); Console.ReadKey(); break; } } break; case "u": Console.Clear(); Console.WriteLine(); Console.WriteLine();
ConsoleColor.Yellow;
Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine("\t\t\t\t Updating Account "); Console.WriteLine("\t\t\t\t **************** "); Console.WriteLine(); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write("\t\tEnter the account number : "); ano = Console.ReadLine(); if (ano.Length == 5) { if (ano.StartsWith("KA")) { string s = ano.Substring(2, 3); int n = Convert.ToInt32(s); for (k = 0; k < i; k++) { if (c1[k].bank_ano == n) { find = true; amt = c1[k].bank_bal; nam = c1[k].bank_name; addr = c1[k].bank_address; pno = c1[k].bank_phno; break; } else find = false; } if (find == true) { Console.Clear(); Console.ForegroundColor =
Console.WriteLine();
Console.WriteLine(); System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t=== Updating
details of " + nam + "=="); Console.WriteLine(); ConsoleColor.Magenta; >Address"); number");
Console.WriteLine(); Console.ForegroundColor = Console.WriteLine("\t\t\t\t1Console.WriteLine(); Console.WriteLine("\t\t\t\t2->Contact Console.WriteLine(); Console.ForegroundColor =
ConsoleColor.Cyan; choice : ");
Convert.ToInt32(Console.ReadLine());
Console.Write("\t\tEnter your int ui; string naddr; int nphno; ui = Console.WriteLine();
switch (ui) { case 1: Console.ForegroundColor = ConsoleColor.White; old address
Console.WriteLine("\t\tYour
: " + c1[k].bank_address);
(1000);
Console.WriteLine(); System.Threading.Thread.Sleep Console.Write("\t\tEnter the
new address : ");
naddr = Console.ReadLine(); Console.WriteLine(); c1[k].bank_address = naddr; Console.WriteLine(); Console.WriteLine(); System.Threading.Thread.Sleep (1000);
Console.ForegroundColor =
ConsoleColor.Yellow;
Console.WriteLine("\t\t====
Details of " + nam + " ==="); (1000); ConsoleColor.Magenta; unt number : " + c1[k].bank_ano); : " + c1[k].bank_name); ess
: " + c1[k].bank_address);
act Number : " + c1[k].bank_phno); nce
: " + c1[k].bank_bal);
Console.WriteLine(); System.Threading.Thread.Sleep Console.ForegroundColor = Console.WriteLine("\t\t\tAcco Console.WriteLine("\t\t\tName Console.WriteLine("\t\t\tAddr Console.WriteLine("\t\t\tCont Console.WriteLine("\t\t\tBala break; case 2: Console.ForegroundColor =
ConsoleColor.White; old contact number
: " +
(1000); new contact number : "); Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
Console.WriteLine("\t\tYour c1[k].bank_phno); Console.WriteLine(); System.Threading.Thread.Sleep Console.Write("\t\tEnter the nphno = Console.WriteLine(); c1[k].bank_phno = nphno; Console.WriteLine();
System.Threading.Thread.Sleep
(1000);
Console.ForegroundColor =
ConsoleColor.Yellow;
Console.WriteLine("\t\t====
Details of " + nam + " ====");
Console.WriteLine(); System.Threading.Thread.Sleep (1000);
Console.ForegroundColor =
ConsoleColor.Magenta;
Console.WriteLine("\t\t\tAcco
unt number : " + c1[k].bank_ano);
Console.WriteLine("\t\t\tName
: " + c1[k].bank_name); ess
Console.WriteLine("\t\t\tAddr
: " + c1[k].bank_address);
Console.WriteLine("\t\t\tCont
act Number : " + c1[k].bank_phno); nce
Console.WriteLine("\t\t\tBala
: " + c1[k].bank_bal);
break; default: Console.ForegroundColor =
ConsoleColor.Red;
Console.WriteLine("\t\tEnter
the correct option"); }
Console.ReadKey(); break;
} else {
Console.WriteLine(); Console.ForegroundColor =
ConsoleColor.Red;
Console.Beep(); Console.WriteLine("\t\tInvalid account number");
} }
} Console.ReadKey(); break; case "da": Console.Clear(); Console.WriteLine(); Console.WriteLine();
Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine("\t\t\t\t Deleting Account "); Console.WriteLine("\t\t\t\t ************** "); Console.WriteLine(); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write("\t\tEnter the account number : "); ano = Console.ReadLine(); if (ano.Length == 5) { if (ano.StartsWith("KA"))
{
ConsoleColor.Yellow;
string s = ano.Substring(2, 3); int n = Convert.ToInt32(s); for (k = 0; k < i; k++) { if (c1[k].bank_ano == n) { find = true; amt = c1[k].bank_bal; nam = c1[k].bank_name; break; } else find = false; } if (find == true) { Console.Clear(); Console.ForegroundColor = Console.WriteLine();
Console.WriteLine();
System.Threading.Thread.Sleep(1000); Console.WriteLine("\t\t== Deleting account of " + nam + " ==");
Console.WriteLine();
Console.WriteLine();
Console.ForegroundColor =
ConsoleColor.Red; delete the account? (y/n) ");
System.Threading.Thread.Sleep(1000); Console.Write("\t\tAre you sure to Console.WriteLine();
Console.WriteLine();
(yn.Equals('Y')))
char yn; yn = Convert.ToChar(Console.Read()); if ((yn.Equals('y')) || {
ConsoleColor.Magenta;
Console.ForegroundColor = Console.WriteLine("\t\tFirst
withdraw your balance amountRs." + amt); 0);
System.Threading.Thread.Sleep(100 c1[k].bank_ano = 0; c1[k].bank_name = ""; c1[k].bank_desig = ""; c1[k].bank_phno = 0; c1[k].bank_bal = 0; Console.WriteLine();
Console.WriteLine(); ConsoleColor.Green; being our customer");
Console.ForegroundColor = Console.WriteLine("\t\tThanks for
Console.ReadKey();
} else {
Console.WriteLine();
Console.WriteLine();
Console.ForegroundColor =
ConsoleColor.Green;
Console.WriteLine("\t\tYou can
continue as our customer"); }
Console.ReadKey();
} else {
Console.WriteLine(); Console.ForegroundColor =
ConsoleColor.Red;
Console.Beep(); Console.WriteLine("\t\tInvalid account number");
} }
} Console.ReadKey(); break; default: break; } Console.Clear(); } catch { Console.WriteLine("Exception"); Console.ReadKey(); } Console.Clear(); } while ((ch.Trim().ToLower() != "e")); }
}
}