7/20/2010

C# Enumeration



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

namespace Enumerations
{
    enum quali {BE,MCA,MBA,MS}

    enum desig{Engineer=15000,Lecturer=25000,Manager=40000,TeamLead=60000}

    class employee
    {
        public quali Quali;
        public desig Desig;

        public employee(quali Quali, desig Desig)
        {
            this.Quali = Quali;
            this.Desig = Desig;
        }
    }

    class Program
    {
        static void Main(string[] args)        
        {
            employee emp = new employee(quali.MCA, desig.Lecturer);
            Console.WriteLine("Qualification: " + emp.Quali);
            Console.WriteLine("Designation: " + emp.Desig);
            Console.WriteLine("Salary: " + (int)emp.Desig);

        }
    }
}

No comments:

Post a Comment