Project: Combined FICA Tax
Write a program that computes the Social Security and Medicare tax on your paycheck. Creates a floating point constant named FICA_RATE
with the value 0.0765. Create constant for gross pay and variables for net pay and total FICA tax. Be sure to initialize your variables. The gross pay constant should be initialized to your weekly pay amount. Then compute the FICA tax by multiplying FICA_RATE by your gross pay (using *
as the symbol for multiplication) to initialize the FICA tax variable. Then compute net pay by subtracting the FICA tax from gross pay. Print the gross pay, total FICA tax and net pay.
Output
$ javac -Xlint CombinedFICATax.java
$ java -ea CombinedFICATax
Gross Pay: 1000.0
FICA Tax: 76.5
Net Pay: 923.5