Please express those fractions properly: 3/4, 7/8.
Let g be the # of gallons the tank could hold when full.
Then (3/4)n + 5 = (7/8)n.
solving for n: Mult all 3 terms by the LCD (8): 6n + 5(8) = 7n.
Then n=5(8) = 40 (gallons). The tank would hold 40 gallons of water were it full.