Start New Discussion within our Software Development Community

i have encounter problem on my java file,i can't find the solution..just only one error..

here is the java file and it give me an error of error: "reached of end of file while parsing in line 137"

can anyone help me please?thanks in advance..

import java.io.*;
import java.util.*;
public class original
{

public static void main(String[] args) throws IOException 
{

    int loop=0;
    while(loop<3)
    {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String employee_code="";
        String employee_level="";
        String employee_name="";
        String tex="";
        double rate=0;

        System.out.println("input employee codes");
        employee_code = input.readLine();

    }
    BufferedReader con = new BufferedReader(new FileReader("employee.txt"));
    String str;
    int ctrlen=0;

    while((str=con.readLine())!=null)
    {
        ctrlen=ctrlen+1;
    }
    con.close();

    BufferedReader con1=new BufferedReader(new FileReader("employee.txt"));
    String strlo[] = new String[ctrlen];
    int ctr=0;

    while((str=con1.readLine())!=null)
    {
        strlo[ctr]=str;
        ctr++;
    }
    con1.close();
            for(int a=0;a<ctrlen;a++){
                if(strlo[a].equals(employee_code)==true)
                //dito yata yung Try hehe
                    try{
                    employee_level=strlo[(a+1)];
                    employee_name=strlo[(a-1)];
                    tex=strlo[a];

            }

            catch(Exception Enum)
                //dpat may { po after ng Catch statement
                {System.out.println("error");
                            if(employee_level.equals("level1")==true)
                            {
                                rate = 380;
                                double gsismul=.10;

                            }
                            else if(employee_level.equals("level1")==true)
                            {
                                rate = 450;
                                double gsismul=.15;

                            }
                            else
                            {
                                rate=500;
                                double gsismul=.2;
                            }
                            if (tex.equals(employee_code)==true)
                            {
                                System.out.println("employee name" + employee_name);
                                System.out.println("employee name" + employee_name);
                                System.out.println("employee name" + employee_level);

                                Scanner numin = new Scanner(System.in);
                            double time_in=0;
                            double time_out=0;
                            double total_time_per_day=0;
                            double total_worked_hours=0;
                            double ot_in=0;
                            double ot_out=0;
                            double total_ot_per_day=0;
                            double total_ot=0;
                            double holiday_pay=0;
                            String holiday="";
                            String day={"Monday","Tuesday","Wednesday","Thursday","Friday"};
                            int d;

                            for(d=0; d<5;d++)
                            {
                                System.out.print("enter time in for "+day[d]+":");
                                time_in=numin.nextdouble();
                                System.out.print("enter time out for"+day[d]+":");
                                time_out=numin.nextDouble();
                                //Kulang ng isang " po...
                                System.out.print("is"+day[d]+"a holiday?:");
                                holiday = input.readLine();
                                if(holiday.equals("yes")==true)
                                {
                                    holiday_pay=holiday_pay+1;
                                }       
                                    else
                                    {
                                        holiday_pay=holiday_pay+0;
                                    }
                                    System.out.print("enter over time in for"+day[d]+":");
                                    ot_in=numin.nextDouble();
                                    System.out.print("Enter over time out for "+day[d]+":");
                                    ot_out=numin.nextDouble();
                                                    original
                                        total_time_per_day=time_out-time_in;
                                        total_worked_hours=total_worked_hours + total_time_per_day;
                                        total_ot_per_day=ot_out - ot_in;
                                        total_ot=total_ot+total_ot_per_day;

                            }
                            total_worked_hours=total_worked_hours/100;
                            total_ot=total_ot/100;
                            double rate_per_day=rate/8;
                            double gross_income=total_worked_hours*rate_per_day;
                            double doublepay=holiday_pay*rate;
                            double sss=gross_income*0.10;
                            double gsis=gross_income*gsismul;
                            double total_deduction=sss+gsis;
                            double allowance=500;
                            double total_salary=gross_income+total_ot_income+doublepay+allowance;
                            double net_income=total_salary-total_deduction;
                            System.out.print("net income"+net_income);
                            loop = loop+4;

                            }
                            else{
                                System.out.println("error code");
                                loop++;
                            }
                }
            }
        }

The compiler does a very thorough job. Check again.

You have too much code in the catch block. set a flag to remember a condition and exit to handle the processing outside of the catch.

when i add again a } at the end,the error now is 1

"error:class,interface,or enum expected"

when i add again a } at the end,the error now is 1

"error:class,interface,or enum expected"

you added an unnecessary closing bracket, check all the brackets again

When I added ur block of comment in eclipse and tried to execute it ...it showed a lot of errors for variables like total_ot_income is not resolved and many so on.....One closing brace bracket is missing at the end also...try to paste the complete code again and also the error msgs....and what;s in ur text file the employee info??

"reached of end of file while parsing in line 137"

can anyone help me please?thanks in advance..

CHeck the Brackets.... the code ere iz going fine

so only the Brackets have a error?i thought the codes also..:}will check 100% the bracket

This question has already been answered. Start a new discussion instead.