Q1. Write a program to find the count of elements repeating in an array, store the count of those elements in another array respective of the element index number. Assume that elements in the first array have values >=1 and <=10 and it has 200 elements in total. Also print the histogram of the elements showing the frequency of each number.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 14RQ
icon
Related questions
Question

write in c++  using simple programming fundamentals concepts 

Q1. Write a program to find the count of elements repeating in an array, store the count of those
elements in another array respective of the element index number. Assume that elements in the
first array have values >-1 and <=10 and it has 200 elements in total. Also print the histogram of
the elements showing the frequency of each number.
Example with an array of five elements:
Arr[5]: [1, 1, 2, 2, 2]
Output:
Sum[5]: [2, 3, 0, 0, 0]
Example:
Acr[5]: [3, 3, 1, 2, 5]
Output:
Sum[5]: [1, 1, 2, 0, 1]
Transcribed Image Text:Q1. Write a program to find the count of elements repeating in an array, store the count of those elements in another array respective of the element index number. Assume that elements in the first array have values >-1 and <=10 and it has 200 elements in total. Also print the histogram of the elements showing the frequency of each number. Example with an array of five elements: Arr[5]: [1, 1, 2, 2, 2] Output: Sum[5]: [2, 3, 0, 0, 0] Example: Acr[5]: [3, 3, 1, 2, 5] Output: Sum[5]: [1, 1, 2, 0, 1]
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage