Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java Problem #2: [30 pts] Write a program that asks the user to enter his/her: Salary Gender ('m' for male, 'f' for female) Age of
Java
Problem #2: [30 pts] Write a program that asks the user to enter his/her: Salary Gender ('m' for male, 'f' for female) Age of a person Then writes the corresponding tax and the net salary based on the below rules: Women pay 2% Men between 26 and 40 years pay 4% Others men pay 1% taxes if their salary greater than 1500 $ and if not, tax is zero Sample run 1: Enter salary, gender (m or f) and age: 1200 m 30 The tax is 48.0 $ The net salary is 1152.0 $ Sample run 2: Enter salary, gender (m or f) and age: 1550 m 14 The tax is 15.5 $ The net salary is 1534.5 $ Sample run 3: Enter salary, gender (m or f) and age: 1200 m 41 The tax is 0.0 $ The net salary is 1200.0 $ Sample run 4: Enter salary, gender (m or f) and age: 1200 f 25 The tax is 24.0 $ The net salary is 1176.0 $ Sample run 5: Enter salary, gender (m or f) and age: 1200 G 25 Wrong inputStep 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