Question: Need help with a c++ problem. #include //cin,cout,endl #include //strlen() using namespace std; //User Libraries Here //Global Constants Only, No Global Variables //Like PI, e,

Need help with a c++ problem.

Need help with a c++ problem. #include //cin,cout,endl #include //strlen() using namespace

#include //cin,cout,endl #include //strlen() using namespace std; //User Libraries Here

//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

ask >main) and prototypes are supplied. You implement the 3 functions specified by the prototypes Ihe 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 strleno function, the asci table, and the ranges associated with the short data type. Process inputs using the following 1) Write a function that inputs numerical digits in the range of an unsigned short. 2) Write a function that reverses the number to a range 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 io Examples 21->represents 00321- reverse digits 12300 - subtract 999-> results 11301 101a1- No Conversion Possible 99999 - No Conversion Possible 43210-> reverse digits 01234 1234-> subtract 999 results 235 12345-> reverse digits 54321-> No Conversion Possible

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!