Question: Program in C use pointers not array notation int clean_data(int *id, double *amt, char *desig, int *idClean, double *amtClean, char *desigClean, int Size): int *
Program in C
use pointers not array notation
int clean_data(int *id, double *amt, char *desig, int *idClean, double *amtClean, char *desigClean, int Size):
int * - pointer containing original all account IDs information
double * - pointer containing original all amounts information
char* - pointer containing original all designation information
int * - pointer to hold the valid account IDs information
double * - pointer to hold the corresponding valid amounts information
char * - pointer to hold the corresponding valid designation information.
int original size
returns int count of the valid number of IDs.
All the records which conform to the criteria specified by the CS department must be used to fill the second set of int*, double* and char* pointers and then at the end return the count of such valid rows.
In this function, you will loop through the original records and find all those which match the criteria specified and then copy them over to the new set of valid pointers. To do this you should check if each account number is a palindrome (call check_palindrome function on each original ID) and if the corresponding amount value is exactly between $500 and $5000.00 inclusive and the corresponding designation is anything other than P, if these matches then copy that TAs information into the new set of pointers correspondingly and at the end return how many such valid records were copied over. One of the major problems you will run across is indexing, remember that the new valid pointers should start from 0 and must be incremented after every time a new record is added.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
