I need to know how to solve this and what's the reason you chose that way to solve it? is there any other way to solve this

Answer: 1380 females and 1242 males
--------------------------------------------------------------------------------------------
Explanation:
Let x = number of males, y = number of females
The first equation is x/y = 9/10 since the ratio of males to females is 9 to 10
Cross multiply and solve for y
x/y = 9/10
10x = 9y
9y = 10x
y = 10x/9 ... we'll use this equation later below
Another equation to set up is x+y = 2622 since there are a total of 2622 students
x+y = 2622
x+10x/9 = 2622 ... replace y with 10x/9
9*(x+10x/9) = 9*2622 ... multiply both sides by 9
9x+10x = 23598 ... notice how the fraction is canceled out
19x = 23598
x = 23598/19
x = 1242
So there are 1242 male students
y = 10x/9
y = 10*1242/9 .... replace x with 1242
y = 12420/9
y = 1380
and there are 1380 female students
Note how x/y = 1242/1380 = 0.9 which is equal to 9/10. This helps confirm we have the right x and y values. More confirmation is that x+y = 1242+1380 = 2622.