I'm visiting an unfamiliar state. This state has a sales tax of 6.1% but I don't know this. All I know is the tax rate is of the form a.b
% where a
are single digits.
I buy an item at a store and am able to deduce the tax rate from the item's price and the tax amount as listed on the receipt.
What is the minimum cost of the item that would allow me to make such a deduction?
Note: The tax amount listed on the receipt is rounded to the nearest cent.
The first amount for which the rounded tax differs for each of 6%, 6.1% and 6.2% is 5.25 with tax amounts of .31, .32 and .33 respectively.
The program did its calculations in cents and converted to dollars for output:
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For amt = 1 To 1000
subs = 0
For txr = 0.06 To 0.0621 Step 0.001
tx(subs) = Int(amt * txr + 0.5)
subs = subs + 1
If tx(0) <> tx(1) And tx(1) <> tx(2) Then
Text1.Text = Text1.Text & amt / 100 & " " & tx(0) / 100 & Str(tx(1) / 100) & Str(tx(2) / 100) & crlf
This assumes you didn't even know if b was non-zero.
If you knew it was non-zero, a purchase of 3.47 would do, with tax amounts of .20, .21 and .22 for rates of 5.9%, 6.1% and 6.2% respectively.
Posted by Charlie
on 2018-08-22 10:39:55