All you say is possible but the way you do it isn't right
Here ↓ {return m+i;}
Well to do it the tight way know that you can't add m to an int unless you have specified a way to convert the m Object to int or another numeric type such as float or convert to char.
Another way is to add an specific integral or numeric member of the class to the int .
E.g.
1 2
return m.pay+i;///where pay can be a float type or int, however i wont recommend conversion of
///float type to int due to loss of precision in the result.