Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I. Read Chapter 21 II. Write a program to accomplish the following a. Populate a

ID: 665588 • Letter: I

Question

I. Read Chapter 21 II. Write a program to accomplish the following a. Populate an integer array of size N with random values that ranges from 10 to 35 b. Create a tree map with the items in the above list. Use the item alue as the key and the value is the frequency of the key c. Get all entries into a set d. Get key and value for each entry e. Apply some of the Map methods i. containsKeyO, 11. get), ii. put), ii. getValue0, v. getKey0, etc f. Experiment with HashMap, TreeMap, LinkedHashMap III. Attach your work. IIII. Sample output 110 112 115 116 h9 120 121 125 130 131 133 135 IIs 33 in take? true IIs 34 in take? false IKey 34 is not in map IKey 33 occurs:1

Explanation / Answer

II (a)

#include <iostream>
#include <cstdlib>
#include <ctime>

using namespace std;

int main()
{
srand((int)time(0));
int i = 0, n, a[100];
cout<<"Enter limit" << endl;
cin>>n;
for(i=0;i<n;i++)
{
a[i] = (rand() % 35) + 10;
}
for(i=0;i<n;i++)
{
cout<<a[i]<<" ";
}
return 0;
}