mercredi 15 septembre 2021

java if statements with math equation

I'm trying to make a code that applies tax rates to an input but I keep getting an error that says that i'm duplicating a local variable...

    System.out.print("What percentage do you want to withhold for your medical savings account? ");

    mw = pd.nextDouble();
    taxtotal = gross - ud - mw;
    Double taxtotal = pd.nextLine();
    Double taxtotal = pd.next();
    if (taxtotal > 2500) {
        taxtotal * 0.25;
    }
        

Aucun commentaire:

Enregistrer un commentaire