Write a java program to input the ages of '10'students and count the number of students who has the age in between 17-19 (using array )

To write a Java program to input the ages of 10 students and count the number of students who have an age between 17-19 using an array, you can follow these steps:

1. Import the necessary packages for taking input from the user:

```java
import java.util.Scanner;
```

2. Create a Scanner object to read the input from the user:

```java
Scanner scanner = new Scanner(System.in);
```

3. Declare an integer array of size 10 to store the ages of the students:

```java
int[] ages = new int[10];
```

4. Use a loop to iterate through each student and input their age:

```java
for (int i = 0; i < 10; i++) {
System.out.print("Enter age of student " + (i + 1) + ": ");
ages[i] = scanner.nextInt();
}
```

5. Create a counter variable to keep track of the number of students with ages between 17-19 and initialize it to zero:

```java
int count = 0;
```

6. Use another loop to iterate through each student's age and check if it falls between 17-19:

```java
for (int i = 0; i < 10; i++) {
if (ages[i] >= 17 && ages[i] <= 19) {
count++;
}
}
```

7. Finally, print the count of students with ages between 17-19:

```java
System.out.println("Number of students with age between 17-19: " + count);
```

Here's the complete Java program:

```java
import java.util.Scanner;

public class StudentAgeCount {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int[] ages = new int[10];

for (int i = 0; i < 10; i++) {
System.out.print("Enter age of student " + (i + 1) + ": ");
ages[i] = scanner.nextInt();
}

int count = 0;
for (int i = 0; i < 10; i++) {
if (ages[i] >= 17 && ages[i] <= 19) {
count++;
}
}

System.out.println("Number of students with age between 17-19: " + count);
}
}
```

Now you can run the program and input the ages of the 10 students. The program will then count the number of students within the specified age range and display the result.