Convert everything to inches or to feet and find te volume.
Once you have a volume in that unit (call it y), find out how many of these (call this x) are in 1 gallon (from your textbook) --> i am in the UK and we do not use Imperial measurements much anymore, just metric.
Once you have 1 gallon = x (whatevers)
then find 1/x gallons = 1 (whatevers)
then find (1/x)*y gallons = y whatevers.