algorithms – How to write a method that takes two int parameters and return a string?

How do I write a method that takes two int parameters, a and b, and returns a String in the form a=q*b+r where q is the quotient from division and r is the remainder?
Also how do I write a method that takes an int parameter for the number of tokens you have had and prints to the console the number of companions, spells, and resources you can trade for. You can trade in 15 tokens for a companion, 7 tokens for a spell, or 3 tokens for a resource? Thanks!
Photo includes more info: