To find the unit price of gas in dollars per gallon, you can divide the total cost by the number of gallons:
Unit price (dollars per gallon) = Total cost / Number of gallons
Unit price = $24.07 / 5.8 gallons ≈ $4.15 per gallon
So, the unit price of gas is approximately $4.15 per gallon.