Created
December 1, 2013 18:33
-
-
Save peerasak-u/7738989 to your computer and use it in GitHub Desktop.
188110-midterm-2011-2 ข้อ 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| int time = 0; | |
| int temperature = 0; | |
| int bucketHeight = 40; //(H) from picture | |
| float velocity = 0; | |
| float level = 0; //result | |
| cout << "Enter time(t) and temperature(T): "; | |
| //Input Time and Temperature | |
| cin >> time >> temperature; | |
| //find velocity(v) from T | |
| velocity = 331.5 + 0.6 * temperature; | |
| //find level(h) | |
| level = bucketHeight - (time/2) * 0.001 * velocity; | |
| cout << "Level(h) = " << level << " m." << endl; | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment