Question: REFACTORING PRACTICE TASKS Refactoring Practice A Consider the following function definition which is provided to you: int Divisible ( int rem ) i int divisible;

REFACTORING PRACTICE TASKS
Refactoring Practice A
Consider the following function definition which is provided to you:
int Divisible (int rem)
i
int divisible;
if rem ==0(
divisible =1;
} else {
divisible =0
}
return divisible;
}
Can you modify the definition of this function (i.e. the lines of code inside the curly braces) to make it simpler? Hint: it is possible to rewrite this function using just a single line of code (inside the curly braces), so that it behaves exactly the same as defined above.
 REFACTORING PRACTICE TASKS Refactoring Practice A Consider the following function definition

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!