Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

Write A Program That Generates N Random Integers Between 0 And 9 And Displays The Count For Each Number

Write A Program That Generates N Random Integers Between 0 And 9 And Displays The Count For Each Number

Write A Program That Generates N Random Integers Between 0 And 9 And Displays The Count For Each Number

IN JAVA  

Write a program that generates n random  integers between 0 and 9 and displays the count for each number. (Hint:  Use an array of ten integers, say count, to store the counts for the  number of 0s, 1s, . . . , 9s.)

A modular program is expected – use Methods. The program specifications are as below.

  1. In the main() method, declare an int array of size 10, named count.
  2. Implement a method populateCount(int[] cnt) that initializes the array to zero.
  3.  Implement a method countNums(int[] cnt, int n) that accepts  the count array and an integer n. The method should generate n random  numbers in the range of 0 to 9. It should keep a count of how many times  each number, 0 to 9; is generated in the array count.
  4. Implement a method printNums(int[] cnt) to print the count  array.  Note, print “time” or “times” – which ever is appropriate.
  5. Use basic structured programming and procedural programming.
  6.  Write a main() method that declares the count array. Invokes  the countNums() method with n = 10 followed by invoking the printNums().  Then invokes the countNums() method with n = 100 followed  by printNums(). And again, invokes the countNums() method with n =  1000 followed by printNums().
  7. Make sure you invoke  the populateCount(int[] cnt) method at appropriate times. And write out  the heading for each set, n = 10, 100, and 1000.
  8. Documentation. Includes your name, create date and purpose of lab.

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: Writers Hero only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Writers Hero are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Writers Hero is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Writers Hero, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.