View the step-by-step solution to:

Question

# Hello, please help! I can't seem to make that chart with its conversions correctly. Any help would be much

appreciated.

Write a program that prints a table converting miles to/from kilometers, exactly as shown in the sample run. Your
code must demonstrate the use of a while and a for loop (have some of the code done using a while loop and the some
other using the for loop)
Note that: One Mile = 1.6 Kilometer.
Sample run 1: User's entry is in blod
Welcome to the distance converter program (miles&lt;-&gt;kms)
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Enter how many conversions would you like to print ( up to 99) : 15
15 mlies = 24.00 km
1 km = 0.63 miles
14 mlies = 22.40 km
2 km =
1.25 miles
13 mlies = 20.80 km
3 km =
1.88 miles
12 mlies = 19.20 km
4 km =
2.50 miles
11 mlies = 17.60 km
5 km =
3.13 mile s
10 mlies = 16.00 km
6 km =
3.75 miles
9 mlies = 14.40 km
7 km =
4.38 mile s
8 mlies = 12.80 km
8 km =
5.00 mile s |
7 mlies = 11.20 km
9 km =
5.63 miles
6 mlies =
9.60 km
10 km =
6.25 miles
5 mlies =
8.00 km
11 km =
6.88 miles
4 mlies = 6.40 km
12 km =
7.50 miles
3 mlies = 4.80 km
13 km = 8.13 miles |
2 mlies = 3.20 km
14 km = 8.75 miles
1 mlies = 1.60 km
15 km = 9.38 miles |
Thank you for choosing our conversion program!
Sample run 2: User's entry is in blod
Welcome to the distance converter program (miles&lt;-&gt;kms)
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Enter how many conversions would you like to print ( up to 99) :150
Number out of range (1 to 99 lines)! Try again :100
Number out of range (1 to 99 lines)! Try again :0
Number out of range (1 to 99 lines)! Try again :3
3 mlies = 4.80 km
1 km = 0.63 miles
2 mlies =
3.20 km
2 km =
1.25 miles
1 mlies =
1.60 km
3 km =
1.88 miles |
Thank you for choosing our conversion program!

I
G:\Viks'\CheggIndia_Anshu_Office\DevCProjects\main.exe
Welcome to Distance Converter Program: miles &lt;-&gt; Kms.
Enter how many conversions would you like to print (upto 99): 0
Number Out of...

### Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

### -

Educational Resources
• ### -

Study Documents

Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

Browse Documents