Professional Documents
Culture Documents
Account: Using Namespace Class Public Double Public Int Public String Public String
Account: Using Namespace Class Public Double Public Int Public String Public String
using System;
namespace MID_ASSIGNMENT
{
class Account
{
public double currentBalance = 0.0;
public int accountNumber;
public string accountName;
public string address;
else
{
Console.WriteLine(" Balance is insufficient!!");
}
}
internal void DeleteAccount()
{
throw new NotImplementedException();
}
if (accountReceiver == AccountNumber)
{
currentBalance = currentBalance - money;
Console.WriteLine("Transferred money: " + money);
Console.WriteLine("current balance: " + currentBalance);
else
{
Console.WriteLine("Invalid account number!!");
}
a1.accountName = "Indro";
a1.AccountNumber = 11111;
a1.address = "Dhaka";
do
{
Console.WriteLine("1.Account information\n 2.Deposit money\n 3.Withdraw
money\n 4.Transfer money");
Console.WriteLine("Enter your choice: ");
if (input != 0)
{
if (input == 1)
{
Console.WriteLine("Account Information");
Console.WriteLine("Account Number: " + a1.AccountNumber);
Console.WriteLine("Account Holder Name: " + a1.AccountName);
Console.WriteLine("Account Holder Address: " + a1.Address);
Console.WriteLine("Balance: " + a1.currentBalance);
if (input == 2)
{
Console.WriteLine("Deposit");
Console.WriteLine("Enter Amount: ");
double amount =
System.Convert.ToDouble(System.Console.ReadLine());
a1.Deposit(amount);
}
if (input == 3)
{
Console.WriteLine("Withdraw");
if (input == 4)
{
Console.WriteLine("Transfer");
int accountReceiver =
System.Convert.ToInt32(System.Console.ReadLine());
a1.Transfer(accountReceiver, money);
}
}
else
{
break;
}
} while (1 != 0);
}
}
}
BANK
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MID_ASSIGNMENT
{
class Bank
{
}
}
}
PROGRAM
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MID_ASSIGNMENT
class Program1
{
static void Main(string[] args)
{
Account a1 = new Account();
Address ob1 = new Address("11", "11/A", "Dhaka", "Bangladesh");
Bank b1 = new Bank("CHOWDHURY BANK", 3);
a1.accountName = "Indro";
a1.AccountNumber = 1;
do
{
Console.WriteLine("1.Account Delete\n 2.Deposit money\n 3.Withdraw
money\n 4.Transfer money\n");
Console.WriteLine("Enter Option: ");
if (input != 0)
{
if (input == 1)
{
b1.Addaccount(a1);
Console.WriteLine("Address is: ");
ob1.ShowAddress();
Console.WriteLine("Do you want to delete your account ");
Console.WriteLine("Enter Account Number:");
if (input == 2)
{
Console.WriteLine("Deposit");
Console.WriteLine("Enter amount: ");
double Amount =
System.Convert.ToDouble(System.Console.ReadLine());
a1.Deposit(Amount);
if (input == 3)
Console.WriteLine("Withdraw");
if (input == 4)
{
Console.WriteLine("Transfer");
Console.WriteLine("Enteramount: ");
double money =
System.Convert.ToDouble(System.Console.ReadLine());
a1.Transfer(accountReceiver, money);
else
{
break;
}
}
} while (1 != 0);
}
}
}