Sales tax is calculated

A based on the number of items purchased.
B using a percentage of the price of an item.
C before a sale discount is applied.
D as a percentage based on federal law.