Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Needed some help on how to go about this only using material up to chapter 4, which includes Expressions and Interactivity (Chapter 3) and Making
Needed some help on how to go about this only using material up to chapter 4, which includes Expressions and Interactivity (Chapter 3) and Making Decisions (Chapter 4), as well as using switches. We cannot use Loops or global variables.
Goal: using switches Remember that you can look at the Lab 1 write-up if you are unsure of how to use Visual Studio Problem: A friend of yours is corresponding with someone from a country in where the metric system is used. This friend has trouble with converting distances. You are going to create a program to help your friend. This program should have 6 conversion choices: convert inches to centimeters, convert yards to meters, convert miles to kilometers, convert centimeters to inches, convert meters to yards, and convert kilometers to miles. The program should output be conversion choices with a,corresponding single letter or digit to represent the conversion (see partial menu below). Use asimple if to ensure the user enters one of the letters or digits. Enter your choice based on the following menu. A Convert inches to centimeters B. Convert yards to meters C. Convert miles to kilometers Next use a switch structure with 6 branches to prompt the user to enter the value to be converted, calculate the converted value, and output the entered value and converted value along with the units. You should assume that the user enters a valid distance to be converted. Do not use any ifs for selecting which conversion to complete. Output all values to 4 significant digits. Do not use any concepts beyond Chapter 4 of your textbookStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started