shayshep 0 Newbie Poster

I am trying to write a program that finds sin(x) using the function double sine( double x, double tolerance, int limit, int & nTerms). I know I have to use the taylor series but I am having trouble getting started.

#include <iostream>
#include <cmath>
using namespace std;

double factorial(double n){
double i;
double result =1;
if( n>0){
for(i=1; i<=n; i++){
result = result * i;
}
}
return result;

This is all the code I have and I'm not sure how to make it work with the function