Example #1
0
 public Savings(string name, DOB DOB, string nominee, double balance)
     : base(name, DOB, nominee, balance)
 {
     base.type = "Savings";
     Console.WriteLine("Savings Account created successfully with input values...!");
 }
Example #2
0
 public Debit(string name, DOB DOB, string nominee, double balance)
     : base(name, DOB, nominee, balance)
 {
     base.type = "Debit";
     Console.WriteLine("Debit Account Created Successfully With Given Values....!");
 }
Example #3
0
 public Account(string n, DOB d, string nm, double bl)
 {
     name = n;
     ID = IDGENERATOR.generate();
     DOB = d;
     nominee = nm;
     balance = bl;
 }
Example #4
0
        public void create_account()
        {
            int d, m, y, accountType;
            double balance;
            string name,nominee;

            Console.WriteLine("Enter account Type : ");
            Console.WriteLine("0. Debit Account");
            Console.WriteLine("1. Credit Account");
            Console.WriteLine("2. Savings Account");

            accountType = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Enter account name : ");
            name = Console.ReadLine();

            Console.WriteLine("Enter Date of Birth (dd-mm-yyyy) : ");
            d = Convert.ToInt32(Console.ReadLine());
            m = Convert.ToInt32(Console.ReadLine());
            y = Convert.ToInt32(Console.ReadLine());

            DOB dob = new DOB();
            dob.set(d, m, y);

            Console.WriteLine("Enter Nominee name : ");
            nominee = Console.ReadLine();

            Console.WriteLine("Enter account Balance : ");
            balance = Double.Parse(Console.ReadLine());

            switch (accountType)
            {
                case 0:
                    accounts.Add(new Debit(name, dob, nominee, balance));
                    break;
                case 1:
                    accounts.Add(new Credit(name, dob, nominee, balance));
                    break;
                case 2:
                    accounts.Add(new Savings(name, dob, nominee, balance));
                    break;
                default:
                    Console.WriteLine("Wrong Input");
                    break;
            }
        }
Example #5
0
 public Account()
 {
     name = "Empty";
     ID = IDGENERATOR.generate();
     DOB = new DOB();
     nominee = "Empty";
     balance = 0.0;
 }