Where do they set assignments like that requiring poor class design? Or no hint of object‑oriented design?olu idowu wrote:. . . class that uses the following private arrays as fields . . . relate the data in each array through the index/subscripts. . . .
olu idowu wrote:After storing value in each array...
Paul Clapham wrote:
olu idowu wrote:After storing value in each array...
You didn't put any arrays in your program. So you didn't store the employee ID, or any other employee information in those missing arrays. So when you get to the end of the input process, there aren't any arrays containing the employee information that you need.
olu idowu wrote:it's still giving me error
But that is different from what you said you had been instructed to do, in your other thread. However bad the instructions might be, you will have to follow them if you want good marks.olu idowu wrote:I made a java code: . . . .
Carey Brown wrote:The obvious answer is to put it outside of the for() loop, either before or after.
Carey Brown wrote:The obvious answer is to put it outside of the for() loop, either before or after. If that is not possible then you'd need an if() that would be true at one point in the loop iterations.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
That code won't work. You were told to create multiple arrays, which is bad design, but you have to do what you are told if you want good marks. You are not showing any sign of using the arrays in that loop. You did have arrays in your earlier code. You are going to have to put those data into the arrays.olu idowu wrote:. . . this code below . . .
Agree. I shall merge the three threads.Carey Brown wrote:. . . continue your questions in your already existing threads.
We can now remind ourselves of the requirements. You appear not to have read them. Your first attempt at code might be better than what you posted more recently, but you neither created the number of arrays specified, nor the size of arrays specified. I know that one of Murphy's Laws reads,the forum software, on my behalf wrote:. . . I have merged your topic into this topic. . . .
but in the case of assignments you need to read the instructions first.When all else fails, read the instructions,
fred rosenberger wrote:well, then fix that error.
In all seriousness, we cannot help you if you don't show us the code that is giving the error. Also, tell us what EXACTLY the error says. You should try and make is as easy as possible for people to help you if you want help.
olu idowu wrote:PLEASE HELP!
How do i do this part at the end of the main method:
This is an example:
I have changed the code and this code works:
Main Method
PayRoll Method
Since the arrays are supposed to have length = 5, a linear search is hardly going to cause slow execution. It will be quick enough to implement, too.Carey Brown wrote:. . . basic linear search . . .
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|