//constructor that also takes the hours each day public Employee(string firstName, string lastName, decimal hourlyRate, decimal[] hoursEachDay) { this.firstName = firstName; this.lastName = lastName; this.hourlyRate = hourlyRate; timeSheetData = new TimeSheetData(hoursEachDay); if (timeSheetData.totalHours > (decimal)37.5) { payAmount = ((decimal)37.5 * hourlyRate) + (timeSheetData.OverTimeHours * (hourlyRate * (decimal)1.5)); } else { payAmount = timeSheetData.totalHours * hourlyRate; } }
//added the timesheet data reference public Employee(TimeSheetData timeSheetData) { this.timeSheetData = timeSheetData; }