kiloToPound.cpp (1pt) Write a program to display the conversion from the odd num
ID: 3826908 • Letter: K
Question
kiloToPound.cpp (1pt)
Write a program to display the conversion from the odd number of kilograms to pounds from 1 to 50.
Given: 1 kilogram = 2.2 pounds
Sample run 1
Kilograms Pounds
--------------------
1 2.20
3 6.60
5 11.00
7 15.40
9 19.80
11 24.20
13 28.60
15 33.00
17 37.40
19 41.80
21 46.20
23 50.60
25 55.00
27 59.40
29 63.80
31 68.20
33 72.60
35 77.00
37 81.40
39 85.80
41 90.20
43 94.60
45 99.00
47 103.40
49 107.80
!!!!!! Please use C++
Explanation / Answer
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
cout<<"Kilograms Pounds"<<endl;
for(int i=1; i<50; i++){
cout<<i<<" "<<fixed<<setprecision(2)<<i*2.2<<endl;
}
return 0;
}
Output:
2 4.40
3 6.60
4 8.80
5 11.00
6 13.20
7 15.40
8 17.60
9 19.80
10 22.00
11 24.20
12 26.40
13 28.60
14 30.80
15 33.00
16 35.20
17 37.40
18 39.60
19 41.80
20 44.00
21 46.20
22 48.40
23 50.60
24 52.80
25 55.00
26 57.20
27 59.40
28 61.60
29 63.80
30 66.00
31 68.20
32 70.40
33 72.60
34 74.80
35 77.00
36 79.20
37 81.40
38 83.60
39 85.80
40 88.00
41 90.20
42 92.40
43 94.60
44 96.80
45 99.00
46 101.20
47 103.40
48 105.60
49 107.80
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.