Question
C++ Please Follow Instructions Write a program that displays an inches to centimeters conversion table. Your input will be the smallest number of inches and
C++
Please Follow Instructions
Write a program that displays an inches to centimeters conversion table. Your input will be the smallest number of inches and the largest number of inches to be converted. The intervals will be in 6 inch increments. One inch is equivalent to 2.54 centimeters.
Include the following in your program:
1. Include an initial algorithm that outlines your steps. 2. Include a refined algorithm that details how each step will be executed. 3. Prompt the User for the range of your table. For example, prompt the User for the beginning value of the range and the ending value of the range. If the User enters 1inch for the beginning value and 36 inches for the ending value then your chart will look something like this:
Conversion Chart
Inches Centimeters ****** *********** 1 2.54 7 17.78 13 33.02 19 48.26 25 63.50 31 78.74
4. Use a conversion formula to calculate the centimeter equivalents where 1 inch is equal to 2.54 centimeters. 5. Use an outer Do While Loop that will ask the User if they wish to run the program again. 6. Use an inner For Loop structure that will: a. Initialize the For Loop counter to the beginning value entered by the User b. Update the counter by incrementing it by six c. Test the counter by comparing it to the ending value entered by the User d. The body of the For Loop will use the value of the counter as the inches to convert to centimeters 7. Print out each line of the chart with each loop cycle. 8. Print the table using formatting techniques such as set precision and set width. 9. Include the code to pause the output screen. 10. Include the following error checking:
- Do not let the User enter a largest number of inches that is more than 36 inches greater than the smallest number of inches.
- For example, if the User enters a 15 for the beginning number of inches then this will be the smallest number of inches on your chart.
- This means that the ending value for the chart (or the largest number of inches allowed) can be up to, but not greater than 51 inches.
- The ending value must be at least 6 inches greater than the beginning number of inches (since that's our increment size).
- The ending value cannot be less than the beginning value.
Step 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