Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

/*this function prints an error message that depends on an integer parameter. i

ID: 3635551 • Letter: #

Question

/*this function prints an error message that depends on an integer parameter. i dont know how to start or how to do with the integer parameter..please i really need help thanks...in advance

void error message (int error_flag)

{  

/*print the message.     */

switch(error_flag)

{

      case 1:

           printf("error identified in the distance data. ");

           break;

      case 2:

           printf("error identified in the velocity data. ");

           break;

        case 3:

           printf("error identified in the acceleration data. ");

           break;

         default:

           printf("undentified error ocurred. ");

           break;

}

/* void return.    */

return;

}

Explanation / Answer

Ok in this case it should be something lie this:

 

void error message (int error_flag)

{  

void switch(error_flag)

{

}