#include <stdio.h>
#include <stdlib.h>
#include <math.h>
// Define symbolic constant
#define TRUE 1
#define FALSE 0
#define NUM_ROWS 25
// Function prototypes
// double displayTrajectoryTable(double start, double end);
// double computeVelocity(double);

double displayTrajectoryTable(double start, double end)

{
    double t, vel;
    main();
    printf("time \t         Velocity");
    printf("----------------------------\n");
    double v;
    double velocity;
    velocity=calculateVelocity
    increment= (start-end) / (N-1)
    for (t= statTime; t<=endTime; t=t+increment)
    {
        Velocity=calculateVelocity(t);
            printf("%0.2lf\t" t);
            printf("0.2lf\n", velocity);
    }
    return end;

   // Complete the function - call the function computeVelocity
}

double computeVelocity(double t)
{
    double vel;  // rocket velocity
    if (t<=0 || t<=10)
    {
        vel = ((11*(pow(t,2)) - 5*t));
    }
    else if (t>10 || t<=20)
        vel= 1100 - (5*t);
    else if(t>20 || t<=30)
        vel=(50*t)-(2*(pow((20-t),2)));
    else if(t>30)
        vel=1520*((exp(-0.2*(t-30))));
    else
        vel=0;

    return (vel);
}
int main()
{
    double startTime, endTime, t;  // times for creating table.
    int badInput = 1;  // Flag used in loop to get user input
    int start, end, vel;
    do {
        printf("Input a start and end time\n");
        scanf("%lf%lf", &startTime , &endTime);
        if (startTime > endTime){
            printf("Keep entering\n"); 
            continue;
        }
        vel = computeVelocity(t);
        printf("%lf \n",vel);
        // end = displayTrajectoryTable(start, end);
        badInput = 0; // this break your loop 
    } while( badInput );
    t = endTime - startTime;
    
    printf("%d", end);
    return 0;
    // Display Table
}
