You are required to write a C++ program to covert a positive inter code into English name equivalent for the digit. A valid code is of size between four (4) to six (6) digits inclusive. A zero is not allowed in a code.
Example:
If input is 234056 the output is: IVALID CODE(Presence of zero)
If input is 23456 the output is: TWO THREE FOUR FIVE SIX
If input is9349 the e output is: NINE THREE FOUR NINE
If input is245 the output is: INVALID CODE(3 DIGITS)
If input is 2344567 the output is: INVALID CODE (7 DIGITS)
Steps to follow to write the program as follow:
Step1 Input cod
Step2 Count the number of digits in the code
Step3 If there is a zeroin the code, “Invalid Code(presence of zero)”else GOTO step4
Step4 If number of digits is mode of equal than 4 and less or equal than 6, GO TO step 5 else display the following message “INVALID CODE (<number of digits>DIGITS)
Step5 Call function called digit_name tocovert each digit into its equivalent English name.
Display the result
Step6 Print the digits in reverse order.Eg; if input is 13453, reverse order is 35431
Overall valid output: (example)
Input in 12345
Output is:ONE TWO THREE FOUR FIVE
Reverse order of code: 54321
Important:Use array. Loops and function appropriately