I'm unsure if you are a student of mathematics , or computer science or both ?
It would be interesting to know if you have been 'taught' anything relevant towards the task you have now been assigned ? it might point the way to approach what you have been asked to do.
I expect you are being asked to implement the continued fractions algorithm.
Continued fractions (st-andrews.ac.uk)
sidenote : the linked slide does have a rather glaring typo, when discussing sqrt(2) it should be 99/70 rather than 89/70