I'm new to java and I would like to know how to multiply a "double" by a fraction. I want to calculate the taxes on a salary (in France). I have tried :
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Quel est votre salaire brut annuel ?");
double salaireBrut = sc.nextDouble();
double salaireNet = salaireBrut;
if (9710 < salaireBrut && salaireBrut <= 26818) {
salaireNet = salaireBrut * (86 / 100);
}
System.out.prinln(salaireNet);
}
}
So it outputs 0.0 instead of salaireBrut * (86 / 100). Can you guide me on what to change, please ? Thank you in advance.