Question: Using Visual Studio 2019 3. All problems involve writing one or more functions, in addition to some code in main(). You must have one main()

Using Visual Studio 2019
3. All problems involve writing one or more functions, in addition to some code in main(). You must have one main() function only or the program won't compile or run. 4. You are free to write more functions than required if it makes your code simpler or more readable. 5. Comments are required as we discussed in class. The same grading rubric is used for all programming assignments, including homework, projects, and exams. 6. If you can't finish, can't get your code to run, or can't get it to run correctly, turn it in anyway. Partial credit will be given. Above all, don't give up; turn in whatever you have. Problems 1. Unit conversions (30 points) a. Write a function that can convert miles to kilometers or kilometers to miles. b. Pass two parameters to this function: i. A parameter of type double that represents the value to be converted, li. A parameter of type int that indicates whether the conversion is from kilometers to miles or miles to kilometers. (Look up the conversion factors using the internet or the library.) iii. Use an it...else statement with the second parameter to determine whether to convert from miles to kilometers or kilometers to miles C. In main(), call the above function to print the following speeds in both miles per hour (mph) and meters per second (m/s) with one decimal place. There are 1000 meters in a kilometer. Don't forget to convert seconds to/from hours.) For example, if 29 mph were given you should print something like: "29.0 mph is equal to 13.0 m/s" or if 13.0 m/s were given you should print something like: 13.0 m/s is equal to 29.0 mph 10.5 m/s 35 mph 3.2 m/s 73.1 mph 159.7 m/s o eta e
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
