    01: #include <iostream>
    02: #include <vector>
    03:
    04: using namespace std;
    05:
    06: /**
    07:    Raise all values in a vector by a given percentage.
    08:    @param v vector of values
    09:    @param p percentage to raise values by
    10: */
    11: void raise_by_percent(vector<double>& v, double p)
    12: {
    13:    for (int i = 0; i < v.size(); i++)
    14:       v[i] = v[i] * (1 + p / 100);
    15: }
    16:
    17: int main()
    18: {
    19:    vector<double> salaries(5);
    20:    salaries[0] = 35000.0;
    21:    salaries[1] = 63000.0;
    22:    salaries[2] = 48000.0;
    23:    salaries[3] = 78000.0;
    24:    salaries[4] = 51500.0;
    25:
    26:    raise_by_percent(salaries, 4.5);
    27:
    28:    for (int i = 0; i < salaries.size(); i++)
    29:       cout << salaries[i] << "\n";
    30:
    31:    return 0;
    32: }