Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# array of class

public static class Exercise
{
    static int Main(string[] args)
    {
        var StaffMembers = new Employee[3];

        StaffMembers[0] = new Employee();
        StaffMembers[0].EmployeeNumber = 20204;
        StaffMembers[0].EmployeeName = "Harry Fields";
        StaffMembers[0].Status = EmploymentStatus.FullTime;
        StaffMembers[0].HourlySalary = 16.85;

        StaffMembers[1] = new Employee();
        StaffMembers[1].EmployeeNumber = 92857;
        StaffMembers[1].EmployeeName = "Jennifer Almonds";
        StaffMembers[1].Status = EmploymentStatus.FullTime;
        StaffMembers[1].HourlySalary = 22.25;

        StaffMembers[2] = new Employee();
        StaffMembers[2].EmployeeNumber = 42963;
        StaffMembers[2].EmployeeName = "Sharon Culbritt";
        StaffMembers[2].Status = EmploymentStatus.PartTime;
        StaffMembers[2].HourlySalary = 10.95;

        return 0;
    }
}
Source by www.functionx.com #
 
PREVIOUS NEXT
Tagged: #array #class
ADD COMMENT
Topic
Name
8+4 =