-
Notifications
You must be signed in to change notification settings - Fork 0
/
02.12.RunwayLength.cpp
74 lines (64 loc) · 2.04 KB
/
02.12.RunwayLength.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include <iostream>
using namespace std;
/*
============================================================
02.12. Runway Length
By : #bayuyudhasaputra
Lang : idn (bahasa Indonesia)
------------------------------------------------------------
Masalah:
Menentukan panjang minimum runway menggunakan rumus berikut:
panjang = v^2 / 2a
dimana, v adalah kecepatan dalam m/s
a adalah percepatan dalam m/s^2
============================================================
*/
int main()
{
cout << endl
<< "===================================================="
<< endl
<< "02.12. Panjang Minimum Runway"
<< endl
<< "By : #bayuyudhasaputra"
<< endl
<< "Lang : idn (Bahasa Indonesia)"
<< endl
<< endl
<< "----------------------------------------------------"
<< endl
<< endl;
// 1. Menerima inout kecepatan dan percepatan
double kecepatan;
cout << "Input kecepatan (Misal, 15.65): ";
cin >> kecepatan;
cout << endl
<< " (Anda menginput " << kecepatan << " m/s)."
<< endl
<< endl;
double percepatan;
cout << "Input percepatan (Misal, 9.86) : ";
cin >> percepatan;
cout << endl
<< " (Anda menginput " << percepatan << " m/s^2)."
<< endl
<< endl;
// 2. Menghitung panjang minimum runway
double panjang;
panjang = (kecepatan * kecepatan) / (2 * percepatan);
// 3. Tampilkan hasil perhitungan
cout << "Jadi, Panjang runway minimum untuk pesawat dengan"
<< endl
<< endl
<< " kecepatan " << kecepatan << " m/s."
<< endl
<< endl
<< " percepatan " << percepatan << " m/s^2. "
<< endl
<< endl
<< "adalah " << panjang << " meter."
<< endl
<< endl
<< "====================================================";
return 0;
}