Re: Need help With program
Have a pointer in THIRD that tells you where to insert into your array. I reckon you always insert at array[0].
It's hard helping without seeing your code.
Re: Need help With program
Re: Need help With program
This is what I am trying to get done but having a hard time (yes i bet its easy for some of you). lol
Re: Need help With program
Aha, your Company class only knows one Employee, which is overwritten every time. You need a List of Employees in Company.
Look at the UML: Company has an Employee array, which you have forgotten.
Re: Need help With program
hmm so make the array in company instead , hmm and use get methods from employee to put the information in the array?
Re: Need help With program
Quote:
Originally Posted by
PhHein
Aha, your Company class only knows one Employee, which is overwritten every time. You need a List of Employees in Company.
Look at the UML: Company has an Employee array, which you have forgotten.
Ok changing the position of the array helps me now thanks. Any other suggestions you can see I am doing wrongly?
Re: Need help With program
Can you tell me how do I get a return type of an object . On the sheet that has company methods, the return type of getemployee is employee
Re: Need help With program
Re: Need help With program
Quote:
Originally Posted by
PhHein
How is it going to find an employee object with the ID. Sample code will do fine
Re: Need help With program
Loop over the array and compare IDs.
Re: Need help With program
Ok, thanks for the info 1 last question, I would think the get Employee would return a string to the company class, how do i make the statement to return it
Re: Need help With program
Look at table 4! getEmployee returns an Employee. And it's returned to whatever object called it.
Re: Need help With program
Yea, thats the point, I dont understand, I dont understand what would come out when returned thus I dont no what kinda of return statement to make.
Re: Need help With program
return employee;
Did you read the method tutorial I've posted before?
Re: Need help With program
Quote:
Originally Posted by
PhHein
return employee;
Did you read the method tutorial I've posted before?
yes some things were like greek like Passing Reference Data Type Arguments and the first object page was not fully clear for me