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.

Screen Shot 2019-09-23 at 3.59.01 PM.png

Screen Shot 2019-09-23 at 3.59.01 PM.png

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

Top Answer

View the full answer
Image_96.jpg

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

Sign up to view the full answer

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
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question