- Write A C Program To Generate A Table Of Conversions From Kilometres To Miles Or Miles To Kilometres Based On The User 1 (101.48 KiB) Viewed 72 times
Write a C++ program to generate a table of conversions from kilometres to miles or miles to kilometres based on the user
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Write a C++ program to generate a table of conversions from kilometres to miles or miles to kilometres based on the user
Write a C++ program to generate a table of conversions from kilometres to miles or miles to kilometres based on the user input. If the user inputs 'K' or 'k' your program should produce kilometres to miles conversion. If the user inputs 'M' or 'm' your program should produce miles to kilometres conversion. Your program should also prompt the user to enter the starting value, ending value and the step size. Replace MY NAME with your name and 1234567890 with your ID no in the sample output shown Sample outputs are shown in the next page. Formulae: mile = 1.609344 kilometre kilometre = 0.621371 miles Use switch-case and while loop in your program. Note: Each line of your code should have appropriate comments. Page 1 of 3 Jan-Apr Test 2 BEE1053/ EE209 Computing for Engineers Sample output: Enter K of k for Kilometres to Miles : Enter Morm for Miles to Kilometres conversion : K Enter the starting value 1 Enter the maximum value (end value) 10 Enter step size:1 Table generated by MY NAME and ID No is 1234567890 1 Kilometres to miles conversion with increment of 1 1.6093 2 3.2187 3 4.8280 4 6.4374 5 8.0467 б 9.6561 7 11.2654 8 12.8748 9 14.4841 10 16.0934 execution time : 5.894 S Process returned © (@xo) Press any key to continue.