Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Fix The Coding Please, Everything C++. I'll list the issues Program 3 The Errors There are several errors with this submission: 1. You can not

Fix The Coding Please, Everything C++. I'll list the issues

Program 3

The Errors

There are several errors with this submission:

1. You can not use the continue statement to force an IF statement to act like a loop. You must stick to the inherent logic of each structure instead of forcing it to behave like something it wasn't intended for. This alone constitutes a zero for a grade.

2. The conversions are only supposed to be in increments of 6.

3. There is no indentation used in the code.

4. The entire prologue section is missing.

-------------------------------------------------------------------------

The Task

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 1 inch 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.

---------------------------------------------------------------------------------

#include

using namespace std;

int main() { int start, end; int ch=1;

while(ch!=-1){ cout<<"Enter starting and ending range"; cin>>start; cin>>end; if(end36) { cout<<"Invalid range "; continue; } cout<<"Inches\tCentimeters "; cout<<"******\t*********** ";

for(int i=start;i<=end;i++){ cout<>ch; }

return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions

Question

What else should have been included?

Answered: 1 week ago

Question

Know the principles of effective service recovery systems.

Answered: 1 week ago

Question

Explain the service recovery paradox.

Answered: 1 week ago