/* Created by Dr. Ramsey */ /* this program will compute the distance an object has gone based on user input velocity and time */ float s=0; //this is the position variable float v=0; //this is for velocity float t=0; //time //prompt for velocity input and get it from the user cout << "Input the floating point velocity in ft/sec: "; cin >> v; //prompt for time and get it cout << "Input the time in seconds: "; cin >> t; //make some checks to make sure the variables make sense if(t < 0) // negative time? { cout << "Error: Time is negative" << endl; } else // otherwise we can do the computation { s = v * t; cout << "The object went " << s << " feet. " << endl; }