/****************************************************************************** * This program computes the combined FICA taxes with formatted output. * The gross pay is supplied on the command line. * * Copyright © 2020 Richard Lesh. All rights reserved. *****************************************************************************/ #![allow(dead_code)] #![allow(non_snake_case)] #![allow(non_upper_case_globals)] use std::env; const FICA_RATE:f64 = 0.0765f64; fn main() { let args: Vec = env::args().collect(); let mut gross_pay:f64 = args[1].trim().parse::().unwrap_or(0); let mut fica_tax:f64 = gross_pay * FICA_RATE; let mut net_pay:f64 = gross_pay - fica_tax; println!("Gross Pay: {0:.2}", gross_pay); println!("FICA Tax: {0:.2}", fica_tax); println!("Net Pay: {0:.2}", net_pay); }