Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

When you are finished with your program, ask me to give you credit. Do not call me until you have tested your program using all

image text in transcribed
image text in transcribed
When you are finished with your program, ask me to give you credit. Do not call me until you have tested your program using all the 4 test cases given below and made sure you have the right results. You are going to create a Ch+ program (name it conversion.cpp and save it in your cs111) for the following problem. Put comments as you write your program. Your program will ask for the item name (one word), whether or not the item is fragile (the user will enter Y or N) and the length of the item expressed in centimeters (the user will enter a whole number). The program should then convert the length in centimeters to inches (to the nearest inch). 2.54cm = 1 inch Declare a constant and use it when you convert centimeters to inches. const ???? CM_INCH -2.54; Your prompts and outputs should look exactly the same as the following (in each run, the item name. Y or N and the numbers will be different). Mimic my example program in my public directory/cs/slott/es111/round Num.ch TEST 1 Inputs Enter the name of the item: Rug Is this item fragile? Enter Y or N: N Enter the length in centimeters: 312" Rug (N) 312 cm is about 122.835 inches rounded to 123 inches. Thank you for using the program. Good bye. TEST 2 Enter the name of the item: Sofa Is this item fragile? Enter Y or N: Y Enter the length in centimeters: 310 Sofa (Y) 310 cm is about 122.047 inches rounded to 122 inches. Thank you for using the program. Good bye. TEST 3 Enter the name of the item: Mirror Is this item fragile? Enter Y pr N: Y Enter the length in centimeters: 90 Mirror (Y) 90 cm is about 35.4331 inches rounded to 35 inches. Thank you for using the program. Good bye. TEST 4 Enter the name of the item: Button Is this item fragile? Enter Y or N: N Enter the length in centimeters: 1 Button (N) 1 cm is about 0.393701 inches rounded to 0 inches. Thank you for using the program. Good bye

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

More Books

Students also viewed these Databases questions