Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <string.h>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int time = 0;
- int distance = 0;
- double velocity = distance/time;
- string operation;
- cout << "Are you finding velocity, time, or distance?" << endl;
- cin >> operation;
- if (operation == "velocity")
- {
- cout << "What is the time?" << endl;
- cin >> time;
- cout << "What is the distance?" << endl;
- cin >> distance;
- cout << "The answer is " << velocity << endl;
- }
- else if(operation == "time")
- {
- cout << "What is the distance?" << endl;
- cin >> distance;
- cout << "What is the velocity?" << endl;
- cin >> velocity;
- time = distance/velocity;
- cout << "The answer is " << time << endl;
- }
- else if(operation == "distance")
- {
- cout << "What is the time?" << endl;
- cin >> time;
- cout << "What is the velocity?" << endl;
- cin >> velocity;
- distance = time*velocity;
- cout << "The answer is " << distance << endl;
- }
- else
- {
- cout << "Fine be an asshole, see if I care" << endl;
- }
- system("PAUSE");
- return 0;
- }
Add Comment
Please, Sign In to add comment