Write a program to output a table that converts miles to kilometers. Do it for 1 to 10 miles and display the kilometer conversion with two decimal points. Your table should be indented by about dozen spaces from the left margin. The headings should be centred over the numbers. There should be a dotted line under the heading. The column of numbers should be right justified. It should look like the following:
Miles Kilometers
----- ----------
1 1.61
2 3.22
3 4.83
4 6.44
5 8.05
6 9.66
7 11.27
8 12.87
9 14.48
10 16.09
Comments
Leave a comment