Hi guys im making this homework on a program that the user will input the time in seconds and it will calculate the velocity and acceleration based on these formulas. Ive tried to compile the program but im getting 2 times "an illegal else without matching if" now the error is because of the acceleration formula on the second and third if because if i remove them it will compile. I was wondering were can i put the formula? or improove the program?
Thanks
// Homework 2
// Raul Gonzalez
// Y00339371
#include<iostream>
#include<cmath>
using namespace std;
int main ()
{
double seconds, time, velocity, acceleration;
cout<<"Please enter the time in seconds :"<<endl;
cin>>seconds;
time=(seconds/3600);
velocity=(pow(10,-5)*pow(time,3))-(0.0049*pow(time,2))+(0.758*time)+181.36;
if (velocity>=0 && velocity<100)
acceleration=3-(6.2e-5)*pow(velocity,2);
cout<<"You have a Velocity of "<<velocity<<"km/h and a Acceleration of "<<acceleration<<"m/s"<<endl;
else if (velocity>=100 && velocity<150)
acceleration=3-(2.5e-5)*pow(velocity,2);
cout<<"You have a Velocity of "<<velocity<<"km/h and a Acceleration of "<<acceleration<<"m/s"<<endl;
else
acceleration=1+(0.5e-5)*pow(velocity,2);
cout<<"You have a Velocity of "<<velocity<<"km/h and a Acceletation of "<<acceleration<<"m/s"<<endl;
return main ();
}