ok so ive been working on the code for weeks now for class and i dont know how to start inputing a function this is what i have
#include <iostream>
using namespace std;
int main()
{
//declare variable//
const double g = 9.8;
double s =1;
double d;
cout<<"Seconds "<< " Distance" <<endl;
cout<<"========================" <<endl;
for(s=1; s <= 10; s++)
{
//equation for distance falling//
d = ((.5)* g * s * s);
cout << s << " " << d << endl;
}
#pragma region wait
cout<<" Press Enter to Quit";
cin.ignore();
cin.get();
#pragma end region
return 0;
}
the code does what i want it to but how do i get the equation "d = ((.5)* g * s * s)" as the function?