Under the settlement of charges it installed secret software in U.S. vehicles to allow them to emit up to 40 times the amount of legally permitted pollution, Volkswagen agreed to change the way it operates in the United States and other countries.