computing hour & Salary
i have tried the code above to enter time in/out..
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String data = timein,timeout;
System.out.println("Enter the time-in: ");
timein = br.readLine();
System.out.println("Enter the time-out: ");
but my problem is how to compute the time (timeout-timeout) and automatically it will display the salary of the employee?
Time In : 8:00
Time Out : 17:00
DailyRate : 350
The display should be like this:
No. of Hours : 8 hrs
Salary : 350
this scenario, sometimes the employee has late, so that if the no of hours is incomplete.. his salary for that day is based on his hour of work..
hope you get my point pls..
thanks in advance..
look into DateFormat class. But the easy way is to use String.split(":") then call Integer.parseInt() on each value in the array.
oh i see? kindly give me sample sir.. i really dont have any idea regarding java..
don't need sample, thats too trivial. Give it a try first.
i second using split. using any kind of date/time representation is a bit too much for this