Ask Question
25 June, 03:18

Explain why each of the following names does or does not seem like a good variable name to represent a state sales tax rate.

a. stateTaxRate

b. txRt

c. t

d. stateSalesTaxRateValue

e. state tax rate

f. taxRate

g. 1TaxRate

h. moneyCharged

+2
Answers (1)
  1. 25 June, 06:26
    0
    a. stateTaxRate - A good variable name because it represents what it holds, the state sales tax rate, without being too wordy. Also correctly capitalized in camelcase.

    b. txRt - A bad variable name because while short and simple, it is too hard to understand what the variable represents.

    c. t - A very bad variable name if you plan on using the variable often. Far too short and you will forget what it represents and is needed for.

    d. stateSalesTaxRateValue - A bad variable name because it is just too wordy. Cutting it down to A's variable name is much more reasonable

    e. state tax rate - A bad variable name and probably invalid because it has spaces in the name.

    f. taxRate - A good variable name if there are no other tax calculations other than state tax rate. Otherwise you would confuse state vs local tax rate or something, making it a bad variable name.

    g. 1TaxRate - A bad variable name because the number 1 has no reason being in the variable name. It doesn't add anything to the name.

    h. moneyCharged - A bad variable name because it is not specific enough in explaining why the money is being charged and what for.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Explain why each of the following names does or does not seem like a good variable name to represent a state sales tax rate. a. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers