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

Write a programs that: Implements the following functions (the prototype must ma

ID: 3836515 • Letter: W

Question

Write a programs that: Implements the following functions (the prototype must match as given to receive credit): string reverse Tokens(string)://Precondition: Input string is in the format "string, siring2, string3, string4" with the character (called a delimiter) separating each substring.//Postcondition: A string is returned in format "string4, siring3. string2, string1", which is the reverse of the input string (token order is reversed). Mint: use the strings find member function double absolute Difference (double, double);//Precondition: none//Postcondition: The absolute difference of the given arguments is returned, whichever is positive. This function DOES NOT depend on c math. Create a driver to lest the functions above. Record Layouts: None Special Calculations: None Special Processing: None Output Layout: Only the main driver function produces output. This lab does not have specific requirements on what the output is.

Explanation / Answer

#include <stdio.h>

int main(void) {
   int n;
   double a,b,diff;
   char dee[100];
   scanf("%d",&n);
   if(n==1)
   dee=revers_of_string();
   else
   {
   scanf("%d%d",a,b);
   diff=doulbe_diff(a,b);
   }
   printf("%s",dee);
   printf("%f",diff);
   return 0;
}

revers_of_string()
{
int a;
char be[100],a2[100];
scanf("%d",a);
for(i=0;i<a;i++)
{
scanf("%d",&be[i]);
}
for(i=0i<a;i++)
{
for(i = 0; a[i] != ''; ++i)
{
a2[i] = a[i];
}
len=strlen(a2);
a2[len+1]=",";
}
return a2;
}

doulbe_diff(double f,double g)
{
double sa;
sa=f-g;
return sa;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote