In this assessment, you will design and code a Java console…

In this assessment, you will design and code a Java console application that reads in seven integer values and prints out the number of occurrences of each value. The application uses the Java single dimension array construct to implement its functionality. Your program output should look like the sample output provided in the “Count Occurrences in Seven Integers Using Java Single Dimension Arrays Instructions” course file resource. Use the submission template (WeekXSolutionSubmissionTemplate.docx). Your assessment will be scored on the following criteria:

In this assessment, we will be designing and coding a Java console application that counts the occurrences of each value in a given set of integers. The program uses a single dimension array in Java to implement its functionality.

To begin, we need to create a Java class for our program. Let’s name it “CountOccurrences”.

“`java
public class CountOccurrences {

public static void main(String[] args) {
// Code goes here
}

}
“`

Inside the main method, we will prompt the user to enter seven integer values using the Scanner class. We will store these values in an array called “numbers”.

“`java
import java.util.Scanner;

public class CountOccurrences {

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int[] numbers = new int[7];

System.out.println(“Enter seven integer values:”);

for (int i = 0; i < 7; i++) { numbers[i] = scanner.nextInt(); } // Code goes here } } ``` Next, we need to count the occurrences of each value in the array. We will use another array called "occurrences" to store the count for each value. We will initialize this array with all zeros. ```java import java.util.Scanner; public class CountOccurrences { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int[] numbers = new int[7]; int[] occurrences = new int[10]; // Assuming values range from 0 to 9 System.out.println("Enter seven integer values:"); for (int i = 0; i < 7; i++) { numbers[i] = scanner.nextInt(); } for (int i = 0; i < 10; i++) { occurrences[i] = 0; } // Code goes here } } ``` Now, we can iterate through the "numbers" array and update the "occurrences" array accordingly. We will increment the count for each value encountered. ```java import java.util.Scanner; public class CountOccurrences { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int[] numbers = new int[7]; int[] occurrences = new int[10]; // Assuming values range from 0 to 9 System.out.println("Enter seven integer values:"); for (int i = 0; i < 7; i++) { numbers[i] = scanner.nextInt(); } for (int i = 0; i < 10; i++) { occurrences[i] = 0; } for (int i = 0; i < 7; i++) { int value = numbers[i]; occurrences[value]++; } // Code goes here } } ``` Finally, we can print out the number of occurrences for each value using a loop. We will iterate through the "occurrences" array and display the count for each value. ```java import java.util.Scanner; public class CountOccurrences { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int[] numbers = new int[7]; int[] occurrences = new int[10]; // Assuming values range from 0 to 9 System.out.println("Enter seven integer values:"); for (int i = 0; i < 7; i++) { numbers[i] = scanner.nextInt(); } for (int i = 0; i < 10; i++) { occurrences[i] = 0; } for (int i = 0; i < 7; i++) { int value = numbers[i]; occurrences[value]++; } System.out.println("Occurrences of each value:"); for (int i = 0; i < 10; i++) { System.out.println("Value " + i + ": " + occurrences[i]); } } } ``` This completes our Java console application. It reads in seven integer values, counts the occurrences of each value, and prints out the number of occurrences for each value. The program uses a single dimension array to implement its functionality.