The majority of the cost of a gallon of gas is the cost of crude oil. (Brandon Bell/Getty Images)Gasoline and diesel prices have been rising again as the war in Iran drags on, with average U.S. gas prices sitting at $3.98 per gallon in the U.S. on Friday, up 10 cents in the past week.