-
Notifications
You must be signed in to change notification settings - Fork 0
/
02.04.ConvertPoundsIntoKilograms.cpp
45 lines (36 loc) · 1.26 KB
/
02.04.ConvertPoundsIntoKilograms.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
#include <iostream>
using namespace std;
/* ==========================================
02.04. Convert pounds into kilograms
By : Putra
Lang : IDN (Indonesia)
------------------------------------------
Masalah :
Tuliskan suatu program yang mengonversi
berat dari pound ke kilogram. Program
menawarkan prompt kepada pengguna untuk
menginput berat dalam pound. Kemudian,
program mengonversi berat dari pound ke
kilogram.
(Catatan. 1 pound sama dengan 0.454
kilogram)
==========================================
*/
int main() {
// 1. Input berat dalam pound
cout << "Input berat dalam satuan pound (Misal, 6.8) : ";
double beratPound;
cin >> beratPound;
cout << endl;
// 2. Hitung konversi pound ke Kg
double beratKg;
beratKg = beratPound * 0.454;
// 3. Tampilkan hasil konversi
cout << beratPound << " pound sama dengan "
<< beratKg << " Kg." << 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
*/