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.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter12: Points, Classes, Virtual Functions And Abstract Classes
Section: Chapter Questions
Problem 29SA
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT