We have the average rate of fuel consumption for both city and highway.
Driving in the city, the car can travel 15 miles per gallon, while on highway it can travel 20 miles per gallon.
Alternatively, we can say that driving in the city, the car consumes 1/15 gallons per each mile traveled, while on highway it consumes 1/20 gallons per each mile travelled:
Expressing the fuel consumption that way will allow us to calculate easier the total amount of fuel consumed later.
The car will travel 600 miles. 4/5 of that trip will be on highway, therefore the remaining 1/5 will be in the city.
With this information, we can calculate exactly how many miles are traveled on highway and how many in the city:
Then, from those 600 miles traveled, 480 will be on highway while 120 will be on city.
If the travels 120 miles on the city, and it consumes 1/15 gallons per each mile travelled, we can calculate the amount of fuel used in the city as follows:
While travelling 120 miles in the city, the car will consume 8 gallons.
Similarly, for the amount of fuel used while on the highway:
While travelling 480 miles in the city, the car will consume 24 gallons.
Now we know the number of gallons the car used each part of the trip. The total amount used for the whole trip is just the sum of them:
The car will use 32 gallons on its 600-mile trip.