Advertisement
Guest User

convert_knots.cpp

a guest
Jan 16th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. double conversion(int knot){
  5.     double mph, minute, formula;
  6.     formula = (6076.0 / 5280.0);
  7.     mph = knot * formula;
  8.     minute = mph / 60.0;
  9.     return minute;
  10. }
  11.  
  12. int main() {
  13.     int userKnots;
  14.     double answer;
  15.     cout << "Enter in knots to convert to miles per minute: ";
  16.     cin >> userKnots;
  17.     answer = conversion(userKnots);
  18.     cout << answer << endl;
  19.  
  20.     system("pause");
  21.     return 0;
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement