Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

WRITE PROGRAM IN JAVA CODING ! Program 2: Conversion Chart NOTE: You will have two weeks to work on this program. Write a program that

WRITE PROGRAM IN JAVA CODING !

Program 2: Conversion Chart

NOTE: You will have two weeks to work on this program.

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 so there are two lined up columns as shown above. 9. Include the following error checking: a. Do not let the User enter a largest number of inches that is more than 36 inches greater than the smallest number of inches. b. 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. c. 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. d. The ending value must be at least 6 inches greater than the beginning number of inches (since that's our increment size).

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

Step: 3

blur-text-image

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

Students also viewed these Databases questions