Use the removeif algorithm to remove from the vector of


Write a statement to peform each of the following tasks:

a) Use the fill algorithm to fill the entire array of strings named items with "hello".

b) Function nextInt returns the next int value in sequence starting with 0 the first time it's called. Use the generate algorithm and the nextInt function to fill the array of ints named integers.

c) Use the equal algorithm to compare two lists (strings1 and strings2) for equality. Store the result in bool variable result.

d) Use the remove_if algorithm to remove from the vector of strings named colors all of the strings that start with "bl". Function startsWithBL returns true if its argument string starts with "bl". Store theiterator that the algorithm returns in newLastElement.

e) Use the replace_if algorithm to replace with 0 all elements with values greater than 100 in the array of ints named values. Function greaterThan100 returns true if its argument is greater than 100.

f) Use the minmax_element algorithm to find the smallest and largest values in the array of doubles named temperatures. Store the pair of iterators that's returned in result.

g) Use the sort algorithm to sort the array of strings named colors.

h) Use the reverse algorithm to reverse order of the elements in the array of strings named colors.

i) Use the merge algorithm to merge the contents of the two sorted arrays named values1 and values2 into a third array named results.

j) Write a lambda expression that returns the square of its int argument and assign the lambda expression to variable squareInt.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Use the removeif algorithm to remove from the vector of
Reference No:- TGS02169883

Expected delivery within 24 Hours