answersLogoWhite

0

I'd first add an input line of some sort, prompting the user to enter the amount.

Next, take the text that's entered and give an error if it's not numeric.

If it is numeric text, convert it to a real number.

Then depending on whether or not the two separate taxes are supposed to be compounded, either multiply it by 1.04 and again by 1.02, or simply multiply it by 1.06 (the former of the two options if it's compounded).

Finally, output the number, rounding to the nearest hundredth.

User Avatar

Wiki User

13y ago

Still curious? Ask our experts.

Chat with our AI personalities

LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao
CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach
EzraEzra
Faith is not about having all the answers, but learning to ask the right questions.
Chat with Ezra

Add your answer:

Earn +20 pts
Q: How would you design a program that asks a user to enter the amount of a purchase and calculate a state sales tax of 4 percent and county tax of 2 percent and give the total of the sale?
Write your answer...
Submit
Still have questions?
magnify glass
imp