Hello, I tried making my first function returning a vector, but I am having some problems with it. Is this set up correctly, with the function initialization and return statement?
1 2 3 4 5 6 7 8 9 10 11
vector<double> calculateSeries(int lån, int år) {
constexprint rente = 10;
vector<double> innbet(år);
double remainderLoan = lån;
for (int i = 0; i < år; i++) {
innbet[i] = (lån/år)+ (rente/100)*(remainderLoan);
remainderLoan -= innbet[i];
}
return vector<double> (innbet);
}