You should be able to just have a few lines of code at the start that populate a std::string fuel_type with either "gasoline" or "disel", then use it where appropriate.  There's no need to duplicate all this code.