Question: c++ visual studio 2012 Write a program that prompts the user to enter a length in inches and outputs the equivalent length in centimeters. If
c++ visual studio 2012

Write a program that prompts the user to enter a length in inches and outputs the equivalent length in centimeters. If the user enters a negative number, throw and handle an appropriate exception and prompt the user to enter another number. 1. Program Processing: a. Begin by writing the declaration of a user-defined exception type named NegativeNumber. b. Write a function ConvertTo Centimeters. The function converts the number of inches sent to the function through the parameter list to centimeters (Note: 2.54 centimeters 1 inch) unless the input value is a negative number, in which case a NegativeNumber exception is thrown. Within the main function, write a try-catch statement within a while loop that prompts for and inputs the number of inches (type double) from the keyboard. The try-catch statement calls the ConvertToCentimeters function and outputs the value returned from the function. If a NegativeNumber exception is thrown, print an error message. c
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
