Explore BrainMass

C++ console program to convert feet + inches to centimeters

This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

Write a C++ program that prompts the user to enter a length in feet and inches and outputs the equivalent length in centimeters. If the user enters a negative number or a non-digit number, throw and handle an appropriate exception and prompt the user to enter another set of numbers.

© BrainMass Inc. brainmass.com March 21, 2019, 9:53 pm ad1c9bdddf

Solution Preview

Please find attached C++ code (file Main.cpp). The program logic is simple to follow. After the ...

Solution Summary

After the welcome message user is prompted to enter length in feet. If we are not able to validate entry an exception is thrown. Exception message is displayed to the user and he is prompted to enter data again. Same thing happens with entry of inches. Then we convert feet and inches to centimeters. The result is displayed.