def cost_impact(data, dist, repm, mode):
    """
    Calculates the cost impact for participants in OpenPATH
    
     Parameters:
        data - participant trip data from OpenPATH
        dist - feature name in df of feature with distance in miles
        repm - feature name in df of feature with replaced mode
        mode - feature name in df of feature with confirmed mode
        
    Returns:
        data with appended cost impact feature for each trip in $$$ (float)
    """
  
    data[mode+'_cost'] = data[dist] * data['cost__trip_'+mode]
    data[repm+'_cost'] = data[dist] * data['cost__trip_'+repm]
    data['Cost_Impact($)'] = round((data[repm+'_cost'] - data[mode+'_cost']),2)

    return data