Ok I know the problem is in the gross section but I dont know why that plus sign is giving me an issue here is the code:
import java.util.Scanner; public class Lab2 { public static void main(String[] args) { System.out.println("Enter hourly wage"); System.out.println("Enter hours worked"); int gross; int wage; int hours; while(hours > -1) { if (hours > 40) { gross =(40*wage)+(1.5*wage*(hours-40)); System.out.println(gross); } else gross = (wage*hours); System.out.println(gross); } }
The compile error says "possible loss of precision"
gross =(40*wage)+(1.5*wage*(hours-40));
^
found: double
required: int
I am new to this stuff but I know that I never declared anything in the code as double