Question: Prepare a new test table with at least 3 distinct test cases listing input and expected output for the new code you created for the

Prepare a new test table with at least 3 distinct test cases listing input and expected output for the new code you created for the Shrink function.

#include

int Square(int value);

int Cube(int value);

double shrink(int value);

int main ()

{

int intValue, menuSelect,Results;

intValue = 1;

// While a positive number

printf ("Enter a positive Integer : ");

scanf("%d", &intValue);

if (intValue > 0)

{

printf ("Enter 1 to calculate Square, 2 to Calculate Cube 3 to Shrink : ");

scanf("%d", &menuSelect);

if (menuSelect == 1)

{

// Call the Square Function

Results = Square(intValue);

printf("Square of %d is %d ",intValue,Results);

}

else if (menuSelect == 2)

{

// Call the Cube function

Results = Cube(intValue);

printf("Cube of %d is %d ",intValue,Results);

}

else if (menuSelect == 3){

//call the shrink function

double Result=shrink(intValue);

printf("%d value after shrink %lf",intValue,Result);

}

}

return 0;

}

/* function returning the Square of a number */

int Square(int value)

{

return value*value;

}

/* function returning the Cube of a number */

int Cube(int value)

{

return value*value*value;

}

double shrink(int value){

return value/2;

}

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!