Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that calculates customers' income taxes using the following rules: The amount of taxes owed equals the taxable income times the tax rate.
Write a program that calculates customers' income taxes using the following rules: The amount of taxes owed equals the taxable income times the tax rate. Taxable income equals gross income minus $1,000 for each exemption. The taxable income cannot be less than zero. The tax rate is computed using the following table: Filing Status Taxable Income Tax Rate single irrelevant 20% married irrelevant 25% cohabiting less than $20,000 10% $20,000 - $50,000 15% more than $50,000 30% For each customer processed, the program should print the customer's tax rate, taxable income, and taxes owed. The program should allow the user to process additional customers as long as he/she enters y' or 'Y' in response to a Process another customer? (y): "prompt. The program should perform input validation for the customer's filing status (only 's', 'S', 'm', 'M', 'c', and 'C' are acceptable). Use a switch statement when calculating a customer's tax rate. Combine related case choices by putting them on the same line. For example, since the user may enter either s' or 'S' to indicate single, use an appropriate multi-label case clause (this varies depending on the switch version you use in your code). Use an appropriate do loop. a) Write and debug a Java program for this algorithm. It should be able to produce the customer data correctly. Come up with your own customer details. b) As an option, perform input validation for the other input entities: gross income (>= 0.0), number of exemptions (>= 0)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started