Example #1
0
        public static void AddRider(ref InsurancePolicy p)
        {
            Console.WriteLine("No.\t\t\t\tDesc\t\t\t\tAdditional Premium\t\t\t\tAdditional Payout\t\t\t\t\n==============");
            foreach (Rider r in p.AvailableRider)
            {
                Console.WriteLine("No.{0}\t\t\tDesc{1}\t\t\tAdditional Premium{2}\t\t\tAdditional Payout{3}\t\t\t\n==============", r, r.Desc, r.AdditionalPremium, r.AdditionalPayout);
            }

            int option = Convert.ToInt16(Console.ReadLine());

            p.AddRider(p.AvailableRider[option]);
        }