Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a java program to calculate the net income for a person by using three methods. Ask the user for the gross income amount
Write a java program to calculate the net income for a person by using three methods. Ask the user for the gross income amount using JOptionPane. It will then call the method (pg 272) to calculate and print the net income. Method 1: Write a void method (pg 271) to calculate net income that receives the income amount. Call the find tax method (pg 272), passing the income amount to the find tax rate (pg 279). Use the rate to calculate the tax amount. Then call the net income print method passing income and tax amount (pg 282). Method 2: Write a value-returning method (pg 293) that finds the tax percentage using the brackets below (similar to Java 2, but its goal is only the find and return the rate). 0.00 - 40,000.01 Over 40,000.00 10% 100,000.00 15% 100,000.00 20% Method 3: Write a void method that receives the income amount and the tax amount, then display the income, tax amount, and net income (gross minus taxes) using JOptionPane. Example for input of $75,000: Income Amount: $75,000 $11, 250 $63,750 Tax Amount: Net Income: Hints/Tips: It took me a little over 20 minutes to complete. Remember that Java doesn't store percentages, it stores numbers. If you use 15 for the percentage, you must divide it by 100 to get .15. In your case, you can pass back .15 for 15% You can use escape sequence characters (pg 37) in JoptionPane and you can use String.format() like printf (pg 172). You can calculate the net income in the JOptionPane but you must put the equation in parenthesis, or you can calculate it into another field and print that field. main method - get gross income amount, call method to calc net income calc net income method - receiving inc amt, call method to find tax rate by passing inc amt. Calc tax amount. Call method to display amounts by passing inc amt & tax amt calc net income method - receiving inc amt, call method to find tax rate by passing inc amt. Calc tax amount. Call method to display amounts by passing inc amt & tax amt find tax rate method - receiving inc amt, finds tax rate based on income amount (use if elseif) display net income - receiving inc amt, tax amt, displays inc amt, tax amt, and net inc Rubric: - Doesn't have method to calculate net income -50% - Doesn't have method to find tax percentage -25% - Doesn't have method to display net income results -25% - Doesn't use JOptionPane to get variables -10% - Doesn't use JOptionPane to display results -5% - Net income results are incorrect or not displayed -20%
Step by Step Solution
★★★★★
3.49 Rating (172 Votes )
There are 3 Steps involved in it
Step: 1
The Java program that fulfills the requirements youve specified import javaxswingJOptionPane public ...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