Use dictionary to calculate discount