The program MUST perform the following checks: 1. Case-insensitive when asking whether to continue (e.g. accepting both ‘Y’ and ‘y’) 2. When asking for the paid tax amount, the amount cannot be negative or greater than the total income. For other amounts, it shoul

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question
Need help with this problem.
 
 
 
 
 
 
 
 
Required error handling:
The program MUST perform the following checks:
1. Case-insensitive when asking whether to continue (e.g. accepting both ‘Y’ and ‘y’)
2. When asking for the paid tax amount, the amount cannot be negative or greater than the total
income. For other amounts, it should not be negative. If it is invalid, it should continuously ask for a new
amount.
Objectives:
• Use basic Java constructs: if, switch, and repetition (looping)
• Perform simple data type manipulations
• Solve problem, design solution and implement using Java
Requirements:
Description:
Write a program named "CalcTax.java" that calculates taxes from data provided by the user:
1. Ask the user for the PIN code. The user must enter either 5678 or 8765 to continue with the program,
otherwise exit the program and the user can try up to 3 times.
2. Ask the user for W2 income amount, any interest, deduction and paid tax amount
3. Calculate the actual tax amount based upon the given income and data
4. Continuously ask the user to enter another set of data until the user chooses to exit the program
Java I
PROGRAMMING PROJECT #1
1. The program must produce similar output.
2. The tax rate is based on the following table:
Actual Income
< $50,000
$50,000 < $75,000
$75,000 $100,000
Above $100,000
Tax rate
15%
20%
25%
30%
3. The tax amount is calculated based upon the actual income (income + interest - deduction)
4. Print out "due" or "refund" based upon the proper tax amount result
5. You need to write at least 1 method.
Transcribed Image Text:Objectives: • Use basic Java constructs: if, switch, and repetition (looping) • Perform simple data type manipulations • Solve problem, design solution and implement using Java Requirements: Description: Write a program named "CalcTax.java" that calculates taxes from data provided by the user: 1. Ask the user for the PIN code. The user must enter either 5678 or 8765 to continue with the program, otherwise exit the program and the user can try up to 3 times. 2. Ask the user for W2 income amount, any interest, deduction and paid tax amount 3. Calculate the actual tax amount based upon the given income and data 4. Continuously ask the user to enter another set of data until the user chooses to exit the program Java I PROGRAMMING PROJECT #1 1. The program must produce similar output. 2. The tax rate is based on the following table: Actual Income < $50,000 $50,000 < $75,000 $75,000 $100,000 Above $100,000 Tax rate 15% 20% 25% 30% 3. The tax amount is calculated based upon the actual income (income + interest - deduction) 4. Print out "due" or "refund" based upon the proper tax amount result 5. You need to write at least 1 method.
Required error handling:
The program MUST perform the following checks:
1. Case-insensitive when asking whether to continue (e.g. accepting both 'Y' and 'y')
2. When asking for the paid tax amount, the amount cannot be negative or greater than the total
income. For other amounts, it should not be negative. If it is invalid, it should continuously ask for a new
amount.
Sample test data and output:
D:\>java CalcTax
Welcome to my tax calculation program.
Please enter the PIN code: 1234
Invalid pin code. Please try it again.
Please enter the PIN code: 56789
Invalid pin code. Please try it again.
Please enter the PIN code: 2345
Invalid pin code. You have reached the maximum number of retries.
Thank you for using my program.
D:\>java CalcTax
Welcome to my tax calculation program.
Please enter the PIN code: 1234
Invalid pin code. Please try it again.
Please enter the PIN code: 2345
Invalid pin code. Please try it again.
Please enter the PIN code: 5678
Please enter the amount from W2 form: 25000
Please enter the interest income: 200
Please enter the paid tax amount: 3500
Please enter the amount for deduction: 1000
Transcribed Image Text:Required error handling: The program MUST perform the following checks: 1. Case-insensitive when asking whether to continue (e.g. accepting both 'Y' and 'y') 2. When asking for the paid tax amount, the amount cannot be negative or greater than the total income. For other amounts, it should not be negative. If it is invalid, it should continuously ask for a new amount. Sample test data and output: D:\>java CalcTax Welcome to my tax calculation program. Please enter the PIN code: 1234 Invalid pin code. Please try it again. Please enter the PIN code: 56789 Invalid pin code. Please try it again. Please enter the PIN code: 2345 Invalid pin code. You have reached the maximum number of retries. Thank you for using my program. D:\>java CalcTax Welcome to my tax calculation program. Please enter the PIN code: 1234 Invalid pin code. Please try it again. Please enter the PIN code: 2345 Invalid pin code. Please try it again. Please enter the PIN code: 5678 Please enter the amount from W2 form: 25000 Please enter the interest income: 200 Please enter the paid tax amount: 3500 Please enter the amount for deduction: 1000
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education