Here is Assignment07:

public class Assignment07
{
	public static void main(String []args)
	{
		Asn07Employees emps = new Asn07Employees(ids, hours, rate);
		Asn07Employees allEmps[] = new Asn07Employees[7];
		int ids[] = {5658845, 4520125, 7895122, 8777541, 8451277, 1302850, 7580489 };
		int hours[]={ 12,      15,      7,       16,      -1,      20,      15		};
		float rate[]={6.5f,    12.5f,  1.5f,    10,      16.5f,   20,      32.5f   };

		for(int i=0; i < allSt.length; i++)
		{
			allEmps[i] = new Asn07Employees(names[i], scores[i]);
		}

		for(Asn07Employees oneEmps :allEmps)
			print(oneSt.toString());


		emps.calculateWages();
		System.out.println(emps);

		System.out.println("Id\t\tHours\t\tRate\t\tWages" + "\n--\t\t-----\t\t----\t\t-----");
	}

	public static void print(String s)
	{
		System.out.println(s);
	}
}

Here is Asn07Employees:

public class Asn07Employees
{	private int ids[];
	private int hours[];
	private float payrate[];
	private float wages[] = new float [7];

	public Asn07Employees(int _ids[], int _hours[], float _payrate[])
	{	ids = _ids;
		hours = _hours;
		payrate = _payrate;
	}

	public String toString()
	{	String rv = " ";
		return rv;
	}

	public void setIds(int _ids)
	{	ids = _ids;
	}

	public int getIds()
	{	return ids;
	}

	public void setHours(int _hours)
	{	hours = _hours;
	}

	public int getHours()
	{	return hours;
	}

	public void calculateWages()
	{
	}
}

I am having trouble getting the arrays for ids, hours, and payrate to work across both classes.

I must calculate the wages for each id (hours * payrate) and display all arrays in the output.

I know it has something to do with my Asn07Employees class and because an int is required but it keeps finding an int[].

I've been at it for quite some time now, solving the problem may be easy for you but I am still trying to understand Java.

You should use an Employee class for each employee, there's no need for one that holds all of them, and then you won't need arrays int the Employee class.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.