Hello!
I am taking a basic Java course and was hoping for some help. I have a test coming up soon and I was hoping if someone quickly jot down some code for these questions (sample test) so I can study them and learn the process. Also maybe some comments on the side to let me know what is going on each line/block.
Problem 2
You are asked to create a program that calculates a tax table for a city where there is a city, county, and state tax. The city tax rate is 10%, the county rate is 5%, and the state rate is 1.2%. The state rate is not applicable unless the purchase is over $3,000.00, and the county rate only applies if the purchase is over $10,000.
a) In the space below, calculate the total amount due in taxes for a purchase of $11000. Show all your work, including the amount of each tax individually.
b) Sketch a flow chart for determining the total tax rate. Ask the user to enter all the tax rates and a purchase amount first, then show all the steps to calculate and print the correct tax amount.
c) Assume that you have a function
Code:
public static doublecalculateTaxAmount(double purchaseAmount, double cityTaxRate,
double countyTaxRate,
double stateTaxRate)
In the space below, write the code that you would use to calculate the total tax due based on your flowchart in part (b). The function should return the total taxes owed. Note that the func- tion's parameters include the purchase amount and all the tax rates, so your function should not include reading the values from the user (i.e., no Scanner is required).