Question: ( in C + + ) Metric Write a program in Metric / main . cpp that reads pairs of metric distances ( m m

(in C++)
Metric
Write a program in Metric/main.cpp that reads pairs of metric distances
(mm,cm,m, or km ) from the standard input stream until there are no more
values. For each pair, print if the first distance is larger than the second.
Example input:
10mm 14mm
14mm 10mm
12mm 12mm
1cm 10mm
12cm 99mm
12cm 200mm
1km 5677m
100000cm 1000m
Expected output:
10mm is smaller than 14mm
14mm}\mathrm{ is larger than 10mm
12mm}\mathrm{ is the same as 12mm
1cm}\mathrm{ is the same as 10mm
12cm}\mathrm{ is larger than 99mm
12cm}\mathrm{ is smaller than 200mm
1km}\mathrm{ is smaller than 5677m
100000cm is the same as 1000m
( in C + + ) Metric Write a program in Metric /

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 Programming Questions!