Question: Need help completing this c++ problem. /* * File: main.cpp * Author: YOUR NAME HERE * Created on DATE AND TIME HERE * Purpose: Input
Need help completing this c++ problem.

/* * File: main.cpp * Author: YOUR NAME HERE * Created on DATE AND TIME HERE * Purpose: Input something, output it reversed with some modifications * Note:Range should be 5 digits, 321 = 00321 reverse = 12300 before subtraction * 12300 - 999 = 11301 after subtraction * 12300 = 00321 = 321 after reversal and no subtraction */
//System Libraries Here #include
//Global Constants Only, No Global Variables //Like PI, e, Gravity, conversions, or the columns for 2-D arrays
//Function Prototypes Here bool inRange(const char [],unsigned short &);//Output true,unsigned or false bool reverse(unsigned short,signed short &);//Output true,short or false short subtrct(signed short,int);
//Program Execution Begins Here int main(int argc, char** argv) { //Declare all Variables Here const int SIZE=80; //More than enough char digits[SIZE]; //Character digits or not unsigned short unShort;//Unsigned short short snShort; //Signed short //Input or initialize values Here cout>digits; //Test if it is in the Range of an unsigned short if(!inRange(digits,unShort)){ cout Task->main) and prototypes are supplied. You implement the 3 functions specified by the prototypes The idea behind this problem is that you input a certain integer data type and convert. However, a typing error could occur along the way. You need to detect the error or do the conversion if possible. If not then you output no conversion possible. Concepts to use are character arrays, the strlen function, the ascii table, and the ranges associated with the short data-type. Process inputs using the following 1) Write a fco that inputs numerical digits in the range of an unsigned short. 2) Write a funct that reverses the number to nge of a signed short. 3) Only subtract the largest 3 digit number from the reverse if the result is not negative Display 1) The numeric result that falls within the range specified after converting, or 2) No Conversion Possible if any step 1) or 2) is outside the range specified. Note: It is assumed that leading zeros need not be input or printed. A number like 00321 is the same as 321, 00021 is the same as 21 Look at the code and sample test cases for example i/o Examples 321.> represents 00321-3 reverse digits 12300 subtract 999 .> results 11301 101a1-> No Conversion Possible 99999->No Conversion Passible 43210 > reverse digits 01234 >1234 > subtract 999 > results 235 12345-> reverse digits 51321 - No Conversion Possible
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
