예제 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("ENTER ID");
            int id = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("ENTER NAME");
            string Name = Console.ReadLine();

            Console.WriteLine("ENTER ADDRESS");
            string Address = Console.ReadLine();

            Console.WriteLine("ENTER PAN NO");
            string panno = Console.ReadLine();

            Console.WriteLine("Press 1 Calculate PartTime Salary");
            Console.WriteLine("Press 2 Calculate FullTime Salary");
            int ch = Convert.ToInt32(Console.ReadLine());

            switch (ch)
            {
            case 1:
                PartTime p1 = new PartTime();
                Console.WriteLine("Enter Number Of Hour");
                p1.noofhours = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Enter Number Of Salary Per Hour");
                p1.salaryperhour = Convert.ToInt32(Console.ReadLine());
                int sal = p1.Salary();
                p1.GetData(id, Name, Address, panno);
                p1.Display();
                Console.WriteLine("YOUR PART TIIME SALARY IS :-" + sal);
                break;

            case 2:
                FullTime fl = new FullTime();
                Console.WriteLine("ENTER BASIC SALARY");
                fl.Basic = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("ENTER DA AMOUNT");
                fl.DA = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("ENTER HRA AMOUNT");
                fl.HRA = Convert.ToInt32(Console.ReadLine());
                int fullsal = fl.Salary();
                fl.GetData(id, Name, Address, panno);
                fl.Display();
                Console.WriteLine("YOUR FULL TIIME SALARY IS :-" + fullsal);
                break;
            }


            Console.ReadLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("PLEASE ENTER THE FOLLOWING DETAILS:");
            Console.WriteLine("Enter the Name:");
            string name = Console.ReadLine();

            Console.WriteLine("Enter the Id:");
            int id = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Enter the Address:");
            string address = Console.ReadLine();

            Console.WriteLine("Enter the PAN Number:");
            string panno = Console.ReadLine();

            Console.WriteLine("Press 1)PartTime Salary 2)FullTime Salary");
            int choice = Convert.ToInt32(Console.ReadLine());



            switch (choice)
            {
            case 1:
                Console.WriteLine("Enter the no of hours:");
                int no = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Salary per hour:");
                int      sal = Convert.ToInt32(Console.ReadLine());
                PartTime p   = new PartTime();
                p.noofhours  = no;
                p.salperhour = sal;
                p.Get(id, name, address, panno);
                Console.WriteLine("PartTime Salary is: " + p.Salary());
                p.Display();
                break;

            case 2:
                Console.WriteLine("Enter the basic salary:");
                int basic = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Enter the HRA:");
                int hra = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Enter the TA:");
                int ta = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("Enter the DA:");
                int      da = Convert.ToInt32(Console.ReadLine());
                FullTime f  = new FullTime();
                f.basic = basic;
                f.HRA   = hra;
                f.TA    = ta;
                f.DA    = da;
                f.Get(id, name, address, panno);
                Console.WriteLine("FullTime Salary is: " + f.Salary());
                f.Display();
                break;

            default:
                Console.WriteLine("Invalid Choice!");
                break;
            }



            Console.ReadKey();
        }