Pure Programmer
Blue Matrix


Cluster Map

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
$ rustc CombinedFICATax.rs error[E0308]: mismatched types --> CombinedFICATax.rs:8:24 | 8 | static GROSS_PAY:f64 = 1000; | ^^^^ | | | expected `f64`, found integer | help: use a float literal: `1000.0` error: aborting due to previous error For more information about this error, try `rustc --explain E0308`.

Solution