[tex]\frac{x}{y}=\frac{2}{5} \Rightarrow x=\frac{2y}{5}\\
x+y=98\\
\frac{2y}{5}+y=98 |*5\\
2y+5y=490\\
7y=490 \Rightarrow y=70\\
x=\frac{2*70}{5}\\
x=\frac{140}{5}=28\\
.....................................\\
\frac{x}{y}=\frac{3}{7} \Rightarrow x=\frac{3y}{7}\\
y-x=24\\
y-\frac{3y}{7}=24|*7\\
7y-3y=168\\
4y=168 \Rightarrow y=42\\
x=\frac{3*42}{7}\\
x=\frac{126}{7}=18[/tex]