Question: Write a function named reduce that takes one argument, which is an array containing two positive integer values, treats them as the numerator and denominator

Write a function named "reduce" that takes one argument, which is an array containing two positive integer values, treats them as the numerator and denominator of a fraction, and reduces the fraction. That is to say, each of the two elements will be modified by dividing it by the greatest common divisor of the two integers. The function should return the value false (to indicate failure to reduce) if either of the two arguments is zero or negative and should return the value true otherwise (java)(15 Marks)

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!