Ask your own question, for FREE!
Computer Science 20 Online
OpenStudy (anonymous):

i need help writing a program that computes the total sales tax on a $52 purchase. Assume the state sales tax is 4% and the county sales tax is 2%. also with displaying the purchase price, state tax, county tax, and total tax amounts on the screen.

OpenStudy (bibby):

How far are you into the program? Create variable (or constants for the tax rates) and multiply the various rates to the $52 item for each individual tax

OpenStudy (anonymous):

Like bibby said create varibles such as "double purchprice = 52;". Then if you want to print it to the screen just put "System.out.println("The purchase price is: $" + purchprice)". That would print The purchase price is $52.0. The purchase price is a double because in order to calculate the tax you have to multiply it by a double.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!