Price elasticity of demand is defined by Change in Quantity demanded / Change in Price.
Tom ordered 10 gallons of gas without asking about the price. This means that no matter the price, Tom orders the same quantity of gas (quantity demanded does not change with price). His demand is perfectly inelastic, or 0.
Jerry orders $10 worth of gas. This means that no matter how much it gives him, Jerry will pay $10. The price elasticity of demand depends on how much the price changes by.
For example, if price doubles from $5/gal to $10/gal, demand falls by 50% (2 gallons to 1 gallon), making his price elasticity -0.5
If the price increase 10% from $10/gal to $10.10/gal, demand falls 1% from 1 gal to .99 gallons, making his price elasticity -0.1