Guest User

Untitled

a guest
Jun 24th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int etime, distance;
  7.     cout << "Welcome to distance application\n";
  8.     cout << "*******************************\n";
  9.     cout << "Enter the time in seconds: ";
  10.     cin >> etime;
  11.  
  12.     /*
  13.       Distance = (acceleration * time^2)/2
  14.       Where:
  15.          acceleration is 32 ft/sec^2
  16.          time in seconds
  17.          distance in feet
  18.     */
  19.  
  20.     distance = (32 * (etime ^ 2))/2;
  21.  
  22.     cout << "Distance = " << distance << " ft.\n";
  23.  
  24.     return 0;
  25. }
Add Comment
Please, Sign In to add comment