Question: Complete the metric_to_imperial() function that takes a single numeric parameter named kilos. The function should convert the number of kilograms given as a parameter to

Complete the metric_to_imperial() function that takes a single numeric parameter named kilos.

The function should convert the number of kilograms given as a parameter to a number of stones, pounds and ounces.

1 ounce is 28.349523125 g

1 pound is 16 ounces

1 stone is 14 pounds

Note that the total number of ounces used in the calculations should be rounded to the nearest whole number. The number of stones, pounds and ounces are all displayed as whole numbers. The number of kilograms is rounded to 2 decimal places when it is displayed. Your function should print the output in the format shown in the examples below.

Test Expected Got
metric_to_imperial(10.1)
10.1 kilogram(s) is 1 stone(s), 8 pound(s), 4 ounce(s).
metric_to_imperial(0.15)
0.15 kilogram(s) is 0 stone(s), 0 pound(s), 5 ounce(s).
metric_to_imperial(0.14)
0.14 kilogram(s) is 0 stone(s), 0 pound(s), 5 ounce(s).
metric_to_imperial(6.349)
6.35 kilogram(s) is 1 stone(s), 0 pound(s), 0 ounce(s).
metric_to_imperial(6.3502)
6.35 kilogram(s) is 1 stone(s), 0 pound(s), 0 ounce(s).
metric_to_imperial(12.123)
12.12 kilogram(s) is 1 stone(s), 12 pound(s), 12 ounce(s).
metric_to_imperial(2.345)
2.35 kilogram(s) is 0 stone(s), 5 pound(s), 3 ounce(s).
metric_to_imperial(0.015)
0.01 kilogram(s) is 0 stone(s), 0 pound(s), 1 ounce(s).
metric_to_imperial(0.014)
0.01 kilogram(s) is 0 stone(s), 0 pound(s), 0 ounce(s).
metric_to_imperial(4.5)
4.5 kilogram(s) is 0 stone(s), 9 pound(s), 15 ounce(s).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!