this is a program where you enter the wage and hours you work and it spits out the amount of money you should be receiving.. i am getting a possible loss of percision error.
here is my code
thanksimport java.util.Scanner; public class PayCheck { public PayCheck() { Scanner in = new Scanner(System.in); System.out.println("Wage: "); double wage = in.nextDouble(); System.out.println("Hours: "); double hours = in.nextDouble(); } public int getPayCheck() { double pay; if (hours > 40) { pay = (wage*hours)+((hours%40)*(overtime*wage)); } else { pay = wage*hours; } return pay; } private double hours; private double overtime = 1.5; private double wage; }