Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Design a program that converts between Roman Numbers and decimal numbers, then implement that design in C++. See the textbook: Programming Exercises P3.6, P4.12,
Design a program that converts between Roman Numbers and decimal numbers, then implement that design in C++. See the textbook: Programming Exercises P3.6, P4.12, and P4.13 as references. Our specifications for Roman Numbers is on the next page. Your program should: Display a friendly greeting to the user. Prompt the user for a string (either a decimal number or a Roman number) Accept that string. If the value entered is 0 or O, state the number of values converted and exit the program. Identify the type of number entered (Decimal or Roman). Test the string to ensure that it adheres to the required format. If the string does not adhere to the appropriate format, display a message explaining that the user should more carefully read the specifications and exit. Convert the input string to the desired output string by invoking a function. Display the appropriately-formatted output. Display the prompt again. Your program must include these four functions, with these prototypes: bool isvalidDecimalNumber (string s); isvalidRomanNumber (string s); string convertRomanToDecimal (string s); string convertDecimalToRoman (string s); bool You may make use of any other helper functions (such as the one recommended in P4.12) as you see fit. Note: Roman Numbers can be entered in upper and/or lower case. Sample Run (user input in bold): Welcome to Roman Number Conversion! Please enter a value to convert: MCMLXXVII MCMLXXVII (Roman) = 1977 (Decimal) Please enter a value to convert: 1977 1977 (Decimal) is MCMLXXVII (Roman) Please enter a value to convert: HELLO I did not understand input HELLO Please enter a value to convert: 0 2 numbers were converted (1 Decimal to Roman, 1 Roman to Decimal) Thank You for playing Roman Number Conversion! Submit two documents: the .cpp file and a screen shot of your program in action.
Step by Step Solution
★★★★★
3.40 Rating (156 Votes )
There are 3 Steps involved in it
Step: 1
The solution in c11 is as follows CODE include using namespace std Check whether input is number or ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started