c++ code editing, programming assignment help

i am trying to create this code, but i am kind of stuck here, getting a wrong output. i need you to fix this program, and i need to use the recursing function.

You have just gotten a new swimming pool and need to add chlorine to the water. You add 32 ounces of chlorine the first week and 14 ounces every week thereafter. Each week 40% of the chlorine in the pool evaporates.

and this is my code i’ve created.

———————————-

#include <iostream>

#include <cmath>

usingnamespacestd;

void chlorineLeft(int n, double t, int i){ // n is the number of weeks

    t = (t + 14 * n) – (.40) * (t + 14 *i); // t is the total chlorine left

    i++;

    cout << “chlorine left: ” << t << endl;

    if(i<n){

        chlorineLeft(n, t,i);

    }

   

}

int main(){

   

    chlorineLeft(2,32,1);

   

    return 0;

}

"Is this question part of your assignment? We can help"

ORDER NOW