Trying to determine the area of a triangle. Prompted the user for 3 numbers(doubles) and calculated the area of a triangle within the program. The area must be a number of at least 3 decimal places. Yet, the area keeps coming out to 0. What am I doing wrong?
public static void main (String [] args) {
double sideA = 0.0;
double sideB = 0.0;
double sideC = 0.0;
int s = 1/2;
double area = 0.000;
Scanner scnr = new Scanner(System.in);
System.out.println("Enter Side A: ");
sideA = scnr.nextInt();
System.out.println("Enter Side B: ");
sideB = scnr.nextInt();
System.out.println("Enter Side C: ");
sideC = scnr.nextInt();
DecimalFormat fmt = new DecimalFormat("0.###");
area = Math.sqrt((s * (s - sideA) * (s - sideB) * (s - sideC)));
System.out.println("The area of the triangle is: " + fmt.format(area));
return;