Question

Count Occurrences in Seven Integers Using Java Single Dimension Arrays

In this assignment, 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. Full instructions for successfully completing this assignment are included in this resource. Use the submission template available in the resources, WeekXSolutionSubmissionTemplate.docx.

Your assignment will be scored on the following criteria:

  1. Design a program that meets Java single dimensional arrays requirements.
  2. Code an application that exercises single array constructs.
  3. Test the application and document testing.
  4. Explain the approach taken to develop the application and the major decisions made.
  5. Identify relevant fundamental constructs in the submitted program.
  6. Communicates efficiently, effectively, and in an appropriate manner as an IT professional.

Describe your approach to complete the coding for this assignment and explain the major decisions you made in designing a program that meets the specified requirements.

As part of your explanation, be sure to identify the Java constructs you used that are specific and relevant to your program. Depending on the program, these may include the mechanisms for output, input, selection statements, loops, methods, and so forth. I

CAPELLA UNIVERSITY Count Occurrences in Seven Integers Using Java Single Dimension Arrays In this assessment, you will design

0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you have any doubts, please give me comment...

import java.util.*;

public class CountOccurances{

public static void main(String[] args) {

Scanner userIn = new Scanner(System.in);

int arr[] = new int[7];

System.out.print("Please enter 7 integers: ");

for(int i=0; i<7; i++){

arr[i] = userIn.nextInt();

}

System.out.println("Count Occurrences in Seven Integers Using Java Single Dimension Arrays Instructions");

for(int i=0; i<7; i++){

int c = 0;

for(int j=0; j<7; j++){

if(arr[i]==arr[j])

c++;

}

System.out.println(arr[i]+":"+c);

}

}

}

Please provide your sample output, if my output doesn't match...

Add a comment
Know the answer?
Add Answer to:
Count Occurrences in Seven Integers Using Java Single Dimension Arrays In this assignment, you will design...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In pseudocode only Design (pseudocode) a program (name it Occurrences) to determine whether two two-dimensional arrays...

    In pseudocode only Design (pseudocode) a program (name it Occurrences) to determine whether two two-dimensional arrays are equivalent or not. Two arrays are equivalent if they contain the same values in any order. The program main method defines two two-dimensional array of size 3-by-3 of type integer, and prompts the user to enter integer values to initialize the arrays. The main method calls method isEquivalent()that takes two two-dimensional arrays of integer and returns true (boolean value) if the arrays contain...

  • Using Java In this assignment we are working with arrays. You have to ask the user...

    Using Java In this assignment we are working with arrays. You have to ask the user to enter the size of the integer array to be declared and then initialize this array randomly. Then use a menu to select from the following Modify the elements of the array. At any point in the program, if you select this option you are modifying the elements of the array randomly. Print the items in the array, one to a line with their...

  • C++ Single Dimensional Arrays

    Exercise #1: Design and implement a program (name it AssignGrades) that stores and processes numeric scores for a class. The program prompts the users to enter the class size (number of students) to create a single-dimensional array of that size to store the scores. The program prompts the user to enter a valid integer score (between 0 and 100) for each student. The program validates entered scores, rejects invalid scores, and stores only valid scores in the array.  The program...

  • Note: According to the question, please write source code in java only using the class method....

    Note: According to the question, please write source code in java only using the class method. Sample Run (output) should be the same as displayed in the question below. Make sure the source code is working properly and no errors. Exercise #2: Design and implement a program (name it compareArrays) that compares the content of 2 single-dimensional arrays of the same size. The program prompts the users to enter the array size. Then prompts the user to initialize each array...

  • java programe Write a program that prompts the user to enter in an integer number representing...

    java programe Write a program that prompts the user to enter in an integer number representing the number of elements in an integer array. Create the array and prompt the user to enter in values for each element using a for loop. When the array is full, display the following: The values in the array on a single line. The array with all of the elements reversed. The values from the array that have even numbered values. The values from...

  • in JAVA please thanks. (need answer in a few hours !!) Exercise #1: Design and implement...

    in JAVA please thanks. (need answer in a few hours !!) Exercise #1: Design and implement a program (name it LinearBinarySearch) to implement and test the linear and binary search algorithm discussed in the lecture slides. Define method LinearSearch() to implement linear search of an array of integers. Modify the algorithm implementation to count number of comparisons it takes to find a target value (if exist) in the array. Define method BinarySearch() to implement binary search of an array of...

  • Java Question Method and 1 dimension arrays (20) YouTube ㄨ Electronics, Cars, Fashion, Co × Upload...

    Java Question Method and 1 dimension arrays (20) YouTube ㄨ Electronics, Cars, Fashion, Co × Upload Assignment: Program xy 9 Program3.pdf eduardo C Secure https://blackboard.kean.edu/bbcswebdav/pid-736390-dt-content-rid-2804166 1/courses/18SP CPS 2231 06/Program3.pdf Concepts: Methods and one dimensional Arrays Point value: 45 points Write a Java Class that reads students grades and assigns grades based on the following grading "curve .Grade is A if the score is greater than or equal to the highest score - 10 .Grade is B if the score is...

  • Using C++ Design a class called Numbers that can be used to translate integers in the range 0 to ...

    Using C++ Design a class called Numbers that can be used to translate integers in the range 0 to 9999 into an English description of the number. The class should have a single integer member variable: int number; and a static array of string objects that specify how to translate the number into the desired format. For example, you might use static string arrays such as: string lessThan20[20] = {"zero", "one", ..., "eighteen", "nineteen"}; string hundred = "hundred"; string thousand...

  • In this assessment, you will design and code a Java console application that validates the data...

    In this assessment, you will design and code a Java console application that validates the data entry of a course code (like IT4782) and report back if the course code is valid or not valid. The application uses the Java char and String data types to implement the validation. You can use either the Toolwire environment or your local Java development environment to complete this assignment. The requirements of this application are as follows: The application is to read a...

  • In this module, you learned about Arrays in C++ and how to implement arrays within your...

    In this module, you learned about Arrays in C++ and how to implement arrays within your C++ programs. For this assignment, you will implement your knowledge of arrays for Michigan Popcorn Company’s sales management system. Write a program that lets the Michigan Popcorn Company keep track of their sales for seven different types of popcorn they produce: plain, butter, caramel, cheese, chocolate, turtle and zebra. It should use two parallel seven-element arrays: an array of strings that holds the seven...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT