Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 input

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions