start in not passing to the function...how do I make it work.

#include<iostream>
#include <cmath>
#include <iomanip>

using namespace std;


double VelocityCalculation(double initialVelocity, double time)
{

double pow(double,double);
const double GRAVITY = -32.0;
return GRAVITY*time + initialVelocity;
}


double PositonCalculation ( double begin, double speed,double time, double position)
{
const double calculation =1;

return calculation * begin +speed *time + position;



}


int main()
{


const double POSITIVE_HEIGHT = 1000;
const double VELOCITY_LIMIT = -500;
const double new_position =500;
double Velocity_Equation ;
double const TALL =-16;
double start;
double height;
double velocity;
double velocity_answer;
double position_answer;
double moment;
double position;
double Squared;


cout << endl;
cout <<" Program will calculate the position and velocity of a falling object. ";
cout << endl << endl <<endl;
cout <<" Enter the initial height in feet (above 1000): ";
cin >> height;
cout << endl;

while ( height < POSITIVE_HEIGHT )

{ cout << " Invalid answer. Must enter height over 1000:" << endl;
cout << " Enter the initial height in feet (above 1000): ";
cin >> height;
cout << endl; }

cout <<" Enter the intial velocity in ft/sec: ";
cin >> velocity;
cout << endl;



while ( velocity < VELOCITY_LIMIT )

{ cout << " Invalid answer. Must enter velocity over -500: " << endl;
cout << " Enter the velocity above -500): ";
cin >> velocity;
cout << endl; }





do
{
cout << fixed << setprecision(0) << setw(4) << moment << setprecision(2);
cout << setw(18) << setprecision(2) << height << setw(16) << velocity << endl;
moment = moment+ 1;
Squared = moment * moment;
start = TALL * Squared;
velocity = VelocityCalculation (velocity,moment);
if(velocity <= VELOCITY_LIMIT)
{ position_answer - new_position;
velocity=VELOCITY_LIMIT;}
position_answer = PositonCalculation (start,moment,velocity,height);
}while(moment<= 20);





cout<<endl<<endl;
cout << " Press [enter] to exit" <<endl;
cin.ignore(); //needed because of keyboard input
cin.get();
return 0;
}
Topic archived. No new replies allowed.