#include <iostream>
#include <string>
using namespace std;
float time(float distance, float speed){
return distance / speed;
}
int main(){
int laps;
float distance, speed;
string direction;
cout<<"Input number of laps: ";
cin>>laps;
cout<<"Input distance: ";
cin>>distance;
cout<<"Input speed: ";
cin>>speed;
cout<<"Input direction: ";
cin>>direction;
cout<<"\nTime: "<<time(distance, speed)<<endl;
cout<<"Direction: "<<direction<<endl;
return 0;
}
Comments
Leave a comment