The Class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace ConsoleApplication1
{
class Class1
{
private string employeeName = "";
public double workedHours = 0;
public int workedMonths = 0;
public double avg = 0;
public int sum = 0;
public string getName()
{
return employeeName;
}
public void setName(string value)
{
employeeName = value;
}
public double getworkedHours()
{
return workedHours;
}
public void setworkedHours(double workedHours)
{
this.workedHours = workedHours;
}
public int getworkedMonths()
{
return workedMonths;
}
public void setworkedMonths(int month)
{
month = workedMonths;
}
public double getAvg()
{
return avg;
}
public void setAvg(int workedHoursAvg)
{
int[] workedHours = new int[9240];
for (int count = 0; count < workedHours.Length; count++)
{
sum += count;
avg = sum / count;
}
}
}
}the program
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int employeesMonths = 0;
employeeName[] Employees = new employeeName[25];
for (int i = 0; i < Employees.Length; i++)
Employees = new employeeName();
for (int index = 0; index < Employees.Length; index++)
{
Console.Write("Enter your name: ");
Employees[index].setName(Console.ReadLine());
Console.Write("Enter your worked hours: ");
Employees[index].setworkedHours(Console.ReadLine());
Console.Write(" inter your worked months: ");
workedMonths[index].setWorkedMonths(Console.ReadLine());
}
Console.ReadLine();
}
}
}هذا مشروع مادة
c#
مطلوب منا عمل برنامج يوضح اسم الموظف و ساعات العمل و الشهور و ايجاد معدل ساعات العمل في كل شهر ل 25 موظف.
المشكلة :
يظهر لنا اخطاء في البرنامج ولا نستطيع حلها و هي ان البرنامج يظهر ان employeeName و workedHours الموجودين في البرنامج .. غير معرفين في البرنامج و لكننا قمنا بتعريفهم في ال class و لم نستطع ايضا ايجاد معدل الساعات في كل شهر مع اننا قمنا بكتابة الجملة التي تقوم بحساب المعدل في ال class
فأرجو منكم مساعدتنا .. مع العلم ان تسليم هذا المشروع الاسبوع القادم
شكرا جزيلا ..