Question: Write a program that does the following steps: a. stores the following 20 fruits in a map container Fruit. pear, banana, apple, fig, date, watermelon,

Write a program that does the following steps:

a. stores the following 20 fruits in a map container Fruit.

pear, banana, apple, fig, date, watermelon, guava, grape, berry,

orange, blueberry, mimosa, mango, mandarin, grapefruit, lemon,

lime, papaya, peach, eldenberry

the associated string is the fruits name and corresponding int value represents the length of each fruit

b. Print the entire map displaying fruit name & word-length

c. Display all fruits having a word-length > 5

d. Calculate the numerical sum of each fruits name and store it in a vector Sum

e. Print the entire vector Sum

f. Calculate the mean(Mean) value of vector Sum

g. Display all fruits having numerical values less than Mea

C++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!