• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to find the max and min salary of an employee list by using enhanced for loop(not iterator)?  RSS feed

 
Davidd Joness
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to find the max and min salary of an employee list by using enhanced for loop(not iterator)?
 
Knute Snortum
Sheriff
Posts: 4279
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know the structure of the enhanced for loop?  This link show the two forms of the for loop.  Start with that.
 
Davidd Joness
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Knute Snortum wrote:Do you know the structure of the enhanced for loop?  This link show the two forms of the for loop.  Start with that.


Yes I know . Please help me to solve this question
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37496
545
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sounds like homework. What do you have so far. Where are you stuck.

Hint: You'll need at least two local variables in addition to the loop
 
Junilu Lacar
Sheriff
Posts: 11493
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Davidd Joness wrote:Yes I know . Please help me to solve this question

We don't do people's homework for them. First, it's dishonest and second, it deprives you of a learning opportunity. As others have already suggested, post what you have tried and what you are having trouble with. There are many people here who will gladly try to guide you to finding the answers yourself.
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what makes you think that an enhanced for loop doesn't mean using an Iterator? Unless you are using an array, you are using an Iterator.
 
Paul Clapham
Sheriff
Posts: 22832
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Davidd Joness wrote:Please help me to solve this question


First of all: the question sort of implies that you do know how to find the maximum and minimum salaries using some other kind of loop. Is that the case? Because as far as I can see it shouldn't matter at all what kind of loop you use, the logic is identical in all cases.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!