Question
Write a small C++ program that does the following: 1. Declare 1 D array of integers with 20 elements 2. Declare 2 D array of
Write a small C++ program that does the following: 1. Declare 1 D array of integers with 20 elements
2. Declare 2 D array of integers (you should be able to figure the dimensions of this array).
3. Each row of the 2 D array will have the binary equivalent of one integer from the 1 D array
4. Mapping between the two arrays is sequentially (i.e. the first element of the 2 D array is the binary equivalent of the first element of the 1D array).
5. A function that populate the 1 D array randomly with integers from the range [1 31] inclusive
6. A function that will take the 1 D array and the 2 D array as parameters. This function will convert all integers in the 1 D array and store them in 2D array.
7. A function that displays the 1 D array after data generation
8. A function that Displays the 2D array after data conversion 9. Both arrays displayed on same screen to facilitate accuracy.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started