Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int startTemp = 0, endTemp = 0;
  8. double velocity = 0.0;
  9.  
  10. cout.setf(ios::fixed);
  11. cout.setf(ios::showpoint);
  12. cout.precision(1);
  13.  
  14. cout << "Enter the starting temperature, in degrees Celsius: ";
  15. cin >> startTemp;
  16. cout << "Enter the ending temperature, in degrees Celsius: ";
  17. cin >> endTemp;
  18.  
  19. do
  20. {
  21. velocity = 331.3 + (0.61 * startTemp);
  22. cout << "At " << startTemp << " degrees Celsius the velocity of sound is " << velocity << " m\\s\n";
  23. startTemp++;
  24. }while(startTemp <= endTemp);
  25.  
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement