I need some Java help please

Write a program that asks the user how many numbers will be entered and then has the user enter those numbers. When this is done, report to the user the position of the first 7 entered and the last 7 entered. By position we mean, for example, that if the first 7 is the 2nd number entered then its position would be 2.

Sample screen output 1:
How many numbers will be entered? 8
Enter num: 5
Enter num: 7
Enter num: 6
Enter num: 7
Enter num: 1
Enter num: 3
Enter num: 8
Enter num: 6
The first 7 was in position 2
The last 7 was in position 4

Sample screen output 2:

How many numbers will be entered? 8    
Enter num: 5
Enter num: 1
Enter num: 6
Enter num: 5
Enter num: 9
Enter num: 3
Enter num: 8
Enter num: 6
Sorry, no 7's were entered.

I’m pretty sure you should ask stackoverflow for this type of thing. StackOverflow is a programming/dev oriented tech site… this is more for pcb’s/arcadesticks/pads/joystick hardware :slight_smile:

but first try to fill that array (every input should be an array.push or something)
then use indexOf in that array to check for the position of that 7 in that array.
there must be an extra argument in indexOf to start searching from another index (and not by 0 as it may be the default)
then use System.out.println to print your sentences :slight_smile: