Create a vector of strings called words that contains (in order) "Oregon" and "Washington". Then read in three more words (using cin >> stringVariable) and add them to the vector.
Create a vector of strings called words that contains (in order) "Oregon" and "Washington". Then read in three more words (using cin >> stringVariable) and add them to the vector.
Write the function vector<int>;swapEnds(???) that copies the given vector and then swaps the first and last items of the copy before returning the copy. You get to decide on the parameter type to use (whether to take the input by value or reference).
You will need a loop based on the value of the last element. Remember that the last element is at index .size() - 1 and changes each time you remove something from the back.
You will need a loop based on the value of the last element. Remember that the last element is at index .size() - 1 and changes each time you remove something from the back.
Write a function isBlankFree that takes a vector of strings and returns true if there are no empty strings ("") in it. Return false if there is at least one empty string.
Write a function limit that takes a vector of integers and returns a new vector that is a copy of the original where every value less than 0 is set to 0 and every value greater than 100 is set to 100.