Every loaf at the bakery is going up by extra. Write raise_all(prices, extra): use a range-for to add extra to each price in prices. No bread (empty) means nothing changes.
new_prices({10, 12, 8}, 2)→[12, 14, 10]new_prices({}, 5)→[]vector<int> new_prices(vector<int> prices, int extra)#include <vector>
using namespace std;
void raise_all(vector<int> &prices, int extra) {
// your code here: add extra to every price
}
vector<int> new_prices(vector<int> prices, int extra) {
raise_all(prices, extra);
return prices;
}
Run tries the examples. When they look right, Submit.