Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
C#
int num = IFamily.Count;
            if (num == 0)
            {
                Console.WriteLine("Data not available");

            }
            else
            {
                for (int i = 0; i < IFamily.Count; i++)
                {
                    int bal = IFamily[i].Amount + ((IFamily[i].Amount * 4) / 100);
                    Console.WriteLine("Policy name :" + IFamily[i].CustomerName);
                    Console.WriteLine("Policy name :" + IFamily[i].Amount);
                    Console.WriteLine("Policy name :" + IFamily[i].DateofInsurance);
                    Console.WriteLine("Policy name :" + IFamily[i].MaturityDateofThePolicy);
                    Console.WriteLine("Policy name :" + IFamily[i].MaxCoverageLimit);
                    Console.WriteLine("Balance after the maturity period is :{0}", bal);
                    IFamily[i].GetHalfYearlyInstalmentDetails();
                    IFamily[i].GetMonthlyInstalmentDetails();
                    IFamily[i].GetYearlyInstalmentDetails();

                }
            }
        }

        public void Famliy_ExtraFeature()
        {

            try
            {
                if (MaturityDateofThePolicy < DateofInsurance)
                    throw (new UserException());
                else
                {
                    double Erate;
                    Erate = Amount * .10;
                    Console.WriteLine("An extra amount of {0} is provided to you every year ", Erate);
                }
            }
            catch (UserException Ex)
            {
                Ex.displayMat();
            }
        }
        public class UserException : ApplicationException
        {
            public void display()
            {
                Console.WriteLine("no of people can cover this  policy exceeded and max no of people this policy can cover is = 5");
            }
            public void displayMat()
            {
                Console.WriteLine("your policy is not  matured");
            }
        }


    }
}
-------------------------------------------------------------------------------------------
///IGet_Ins_Det.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Insurancehemanth218
{
    interface IGet_Installment_Details
    {
        void GetYearlyInstalmentDetails();
        void GetHalfYearlyInstalmentDetails();
        void GetMonthlyInstalmentDetails();
    }
}</pre>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900