-
Notifications
You must be signed in to change notification settings - Fork 0
/
02.03.ConvertFeetIntoMeters.cpp
39 lines (30 loc) · 1.09 KB
/
02.03.ConvertFeetIntoMeters.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
#include <iostream>
using namespace std;
/* ===========================================
02.03.Convert feet into meters
By : Putra
Lang : IDN (Indonesia)
-------------------------------------------
Masalah :
Tuliskan suatu program yang membaca panjang
dalam satuan kaki kemudian dikonversi ke
meter.
(Catatan : 1 kaki = 0.305 meter)
===========================================
*/
int main() {
// 1. Input panjang dalam satuan kaki.
cout << "Input satuan dalam kaki, (Misal 6.7) : ";
double nilaiKaki;
cin >> nilaiKaki;
// 2. Konversi satuan kaki ke meter.
double nilaiMeter = 0.305 * nilaiKaki;
// 3. Tampilkan hasil konversi.
cout << nilaiKaki << " kaki sama dengan "
<< nilaiMeter << " meter." << endl;
return 0;
}
/*
Liang. 2014. Introduction to Programming with C++ 3rd Edition. London : Pearson Education.
https://www.pearson.com/en-us/subject-catalog/p/Liang-Companion-Website-for-Introduction-to-Programming-with-C-Access-to-Videonotes-3rd-Edition/P200000003422/978013338026
*/