//Solution to hw4.cpp //Created by Dr. Ramsey #include using namespace std; int main() { float a,v,t; //acceleration, velocity and time cout << "Input floating point velocity in ft/s: "; cin >> v; cout << "Input floating point acceleration in ft/(s*s): "; cin >> a; cout << "Input floating point time in s: "; cin >> t; while(t < 0) // bad t { cout << "ERROR time is negative" << endl; cout << "Input positive time in s: "; cin >> t; //get a good t. } double s = (v*t) + (0.5 * a * t * t); //compute distance cout << "The distance is " << s << " feet." << endl; }