Java Language

profileAddey01
majavaprojectfinalexam.zip

maJavaProjectFinalExam/.classpath

maJavaProjectFinalExam/.project

maJavaProjectFinalExam org.eclipse.jdt.core.javabuilder org.eclipse.jdt.core.javanature

maJavaProjectFinalExam/bin/maJavaProjectFinalExam/Employee.class

                package maJavaProjectFinalExam;

                public 
                synchronized 
                class Employee {
    
                public String 
                firstName;
    
                public String 
                lastName;
    
                public String 
                empStatus;
    
                public double 
                hoursWorked;
    
                public double 
                hourlyRate;
    
                public double 
                grossPay;
    
                public double 
                fedTaxes;
    
                public double 
                stateTaxes;
    
                public double 
                netPay;
    
                public 
                static java.util.ArrayList 
                employeeList;
    
                static void 
                <clinit>();
    
                public void Employee();
    
                public void Employee(String, String, String, double);
    
                public void Employee(String, String, String, double, double);
    
                public 
                static double 
                calcGrossPay(Employee);
    
                public 
                static double 
                calcFedTaxes(Employee);
    
                public 
                static double 
                calcStateTaxes(Employee);
    
                public 
                static double 
                calcNetPay(Employee);
    
                public 
                static String 
                getFirstName(Employee);
    
                public 
                static String 
                getLastName(Employee);
    
                public 
                static String 
                getFullName(Employee);
    
                public 
                static String 
                getEmpStatus(Employee);
    
                public 
                static double 
                getHoursWorked(Employee);
    
                public 
                static double 
                getHourlyRate(Employee);
    
                public 
                static double 
                getGrossPay(Employee);
    
                public 
                static double 
                getFedTaxes(Employee);
    
                public 
                static double 
                getStateTaxes(Employee);
    
                public 
                static double 
                getNetPay(Employee);
    
                public 
                static void 
                getEmployeeByLastName(String);
}

            

maJavaProjectFinalExam/bin/maJavaProjectFinalExam/EmployeeDriver$1.class

                package maJavaProjectFinalExam;

                synchronized 
                class EmployeeDriver$1 
                implements java.util.Comparator {
    void EmployeeDriver$1();
    
                public int 
                compare(Object, Object);
}

            

maJavaProjectFinalExam/bin/maJavaProjectFinalExam/EmployeeDriver.class

                package maJavaProjectFinalExam;

                public 
                synchronized 
                class EmployeeDriver {
    
                public void EmployeeDriver();
    
                public 
                static void 
                main(String[]);
    
                public 
                static void 
                sortEmployee(java.util.ArrayList);
    
                public 
                static void 
                printEmployeeDetails();
    
                public 
                static String 
                convertDoubletoCurreny(double);
}

            

maJavaProjectFinalExam/src/maJavaProjectFinalExam/Employee.java

maJavaProjectFinalExam/src/maJavaProjectFinalExam/Employee.java

package  maJavaProjectFinalExam ;
/*{*******************************************
 * Student Name : Moajep Alagaleen
 *   Course Name: Programming Fundamentals
 *   Course Id:CS219DN
 *   JavaProjectFinalExam
********************************************}*/
/*{
 * Purpose of Program:
 * 
 * prgram used to store the values and returns the values when ever the other class requested
 * this program contains all the variables 
 * 
 * }*/

import  java . util . ArrayList ;
public   class   Employee   {
     public   String  firstName ;   //store the first name of employee
     public   String  lastName ;   //Store the last name of employee
     public   String  empStatus ;   //store the employee status
     public   double  hoursWorked ;   //store the no. of hours worked by employee
     public   double  hourlyRate ;   //store the hourly rate of employee
     public   double  grossPay ;   //store the gross pay of employee
     public   double  fedTaxes ;   //store the fed of student
     public   double  stateTaxes ;   //Store the state taxes of employee
     public   double  netPay ;   //stores the net pay of employee 
     public   static   ArrayList < Employee >  employeeList = new   ArrayList < Employee > ();   //Store the list of all employee's in class
    
     public   Employee ()   //default constructor 
     {
        
     }
     //Constructor to populate the employee details in employee object and add it to class list
     public   Employee ( String  firstName ,   String  lastName ,   String  empStatus , double  hourlyRate )  
     {
         Employee  employeeDetails = new   Employee ();   //Create a new employee object and populate values read from user
        employeeDetails . firstName = firstName ; //Initializing the employeeDetails firstName variable
        employeeDetails . lastName = lastName ; //Initializing the employeeDetails lastName variable
        employeeDetails . empStatus = "Exempt" ; //Initializing the employeeDetails empStatus variable
        employeeDetails . hoursWorked = 40.00 ; //Initializing the employeeDetails hoursWorked variable
        employeeDetails . hourlyRate = hourlyRate ; //Initializing the employeeDetails hourlyRate variable
        employeeDetails . grossPay = calcGrossPay ( employeeDetails );   //Call the getGrossPay method to calculate the gross pay
        employeeDetails . fedTaxes = calcFedTaxes ( employeeDetails );   //Call the getFedTaxes method to calculate the federal taxes
        employeeDetails . stateTaxes = calcStateTaxes ( employeeDetails );   //Call the getStateTaxes method to calculate the state taxes
        employeeDetails . netPay = calcNetPay ( employeeDetails );   //Call the getNetPay method to calculate the net pay
        employeeList . add ( employeeDetails );   //Add the employee object to class details employeeList
     }
     //Constructor to populate the employee details in employee object and add it to class list
     public   Employee ( String  firstName ,   String  lastName ,   String  empStatus , double  hoursWorked , double  hourlyRate )  
     {
         Employee  employeeDetails = new   Employee ();   //Create a new employee object and populate values read from user
        employeeDetails . firstName = firstName ; //Initializing the employeeDetails firstName variable
        employeeDetails . lastName = lastName ; //Initializing the employeeDetails lastName variable
        employeeDetails . empStatus = "Non-Exempt" ; //Initializing the employeeDetails empStatus variable
        employeeDetails . hoursWorked = hoursWorked ; //Initializing the employeeDetails hoursWorked variable
        employeeDetails . hourlyRate = hourlyRate ; //Initializing the employeeDetails hourlyRate variable
        employeeDetails . grossPay = calcGrossPay ( employeeDetails );   //Call the getGrossPay method to calculate the gross pay
        employeeDetails . fedTaxes = calcFedTaxes ( employeeDetails );   //Call the getFedTaxes method to calculate the federal taxes
        employeeDetails . stateTaxes = calcStateTaxes ( employeeDetails );   //Call the getStateTaxes method to calculate the state taxes
        employeeDetails . netPay = calcNetPay ( employeeDetails );   //Call the getNetPay method to calculate the net pay
        employeeList . add ( employeeDetails );   //Add the employee object to class details employeeList
     }
     //this method to calculate the grossPay
     public   static   double  calcGrossPay ( Employee  employeeDetails )
     {
         if ( employeeDetails . hoursWorked > 40.00 ) //if employee hours worked is more than 40
             return   ( 40 * employeeDetails . hourlyRate ) + (( employeeDetails . hoursWorked - 40.00 ) * employeeDetails . hourlyRate * 1.5 );   //calulating gross pay, 1.5 times to the hours more than 40
         else
             return   ( employeeDetails . hoursWorked * employeeDetails . hourlyRate );   //grosspay is calculated by hoursworked*hourlyrate
     }
     //this methos to calculate the fedTaxes
     public   static   double  calcFedTaxes ( Employee  employeeDetails )
     {
         return   ( employeeDetails . grossPay * 15 ) / 100 ;   //fedTaxes is the 15% of the grossPay
     }
     //this method to calculate the stateTaxes
     public   static   double  calcStateTaxes ( Employee  employeeDetails )
     {
         return   ( employeeDetails . grossPay * 6 ) / 100 ;   //stateTaxes is the 6% of the grossPay
     }
     //this method to calculate the netPay
     public   static   double  calcNetPay ( Employee  employeeDetails )
     {
         return   ( employeeDetails . grossPay - employeeDetails . fedTaxes - employeeDetails . stateTaxes );   //netPay is the minus of fedTaxes and stateTaxes from grossPay
     }
     //this method to return the employee first name
     public   static   String  getFirstName ( Employee  employeeDetails )
     {
         return  employeeDetails . firstName ;
     }
     //this method to return the employee last name
     public   static   String  getLastName ( Employee  employeeDetails )
     {
         return  employeeDetails . lastName ;
     }
     //this method to return the employee full name
     public   static   String  getFullName ( Employee  employeeDetails )
     {
         return  employeeDetails . firstName + " " + employeeDetails . lastName ;
     }
     //this method to return the employee status
     public   static   String  getEmpStatus ( Employee  employeeDetails )
     {
         return  employeeDetails . empStatus ;
     }
     //this method to return the employee hours worked
     public   static   double  getHoursWorked ( Employee  employeeDetails )
     {
         return  employeeDetails . hoursWorked ;
     }
     //this method to return the employee hourly rate
     public   static   double   getHourlyRate ( Employee  employeeDetails )
     {
         return  employeeDetails . hourlyRate ;
     }
     //this method to return the employee gross pay
     public   static   double   getGrossPay ( Employee  employeeDetails )
     {
         return  employeeDetails . grossPay ;
     }
     //this method to return the employee fed taxes
     public   static   double   getFedTaxes ( Employee  employeeDetails )
     {
         return  employeeDetails . fedTaxes ;
     }
     //this method to return the employee state taxes
     public   static   double   getStateTaxes ( Employee  employeeDetails )
     {
         return  employeeDetails . stateTaxes ;
     }
     //this method to return the employee net pay
     public   static   double   getNetPay ( Employee  employeeDetails )
     {
         return  employeeDetails . netPay ;
     }
     //This method is to display the employee by lastName
     public   static   void  getEmployeeByLastName ( String  lastName )
     {
         //checking whether the array has elements are not
         if ( employeeList . size () <= 0 ) //if there are no elements in the array, displaying the output
         {
             System . out . println ( lastName + " was not found." );
         }
         else   //array has elements then goes to search 
         {
             //Use a loop to traverse through all the employee's in the list
             //index is a loop variable used to print
             int  matchCount = 0 ;   //stores the no. of matches
             for ( int  index = 0 ; index < employeeList . size (); index ++ )
             {
                 //Take each object in the array list into a currentEmployee object and print the details
                 Employee  currentEmployee = employeeList . get ( index );
                 if ( lastName . equals ( currentEmployee . lastName ))   //comparing the inputed lastName with the employee lastName
                     {
                     System . out . println ( currentEmployee . lastName + " was found in " + currentEmployee . firstName +   " " + currentEmployee . lastName );
                    matchCount ++ ;
                     }            
             }
             if ( matchCount <= 0 )   //if zero matches, then displaying the output
                 System . out . println ( lastName + " was not found." );
         }
     }
    
    
}

maJavaProjectFinalExam/src/maJavaProjectFinalExam/EmployeeDriver.java

maJavaProjectFinalExam/src/maJavaProjectFinalExam/EmployeeDriver.java

package  maJavaProjectFinalExam ;
/*{*******************************************
 * Student Name : Moajep Alagaleen
 *   Course Name: Programming Fundamentals
 *   Course Id:CS219DN
 *   JavaProjectFinalExam
********************************************}*/

/*{***************************************************
 * Purpose of program
 * 
 * This program is used to read Employee details like first name, last name, employee status, 
 * no. of hours worked and hourly rate to calculate gross pay,net pay  
 * This program also prints the report of all the empoyee's.
 * This is achieved by displaying a menu to user and allowing him to choose an option
 * 
 }*/
import  java . text . DecimalFormat ;
import  java . text . NumberFormat ;
import  java . util . ArrayList ;
import  java . util . Collections ;
import  java . util . Comparator ;
import  java . util . Locale ;
import  java . util . Scanner ;

public   class   EmployeeDriver   {
         //main method
             public   static   void  main ( String []  args )   {
                 Scanner  inputReader = new   Scanner ( System . in );   //inputReader object to read data from user 
                 int  choice = 0 ;   //choice stores the menu option entered by user
                 String  firstName ,  lastName , empStatus ;   //lastName stores the last name of employee, firstName stores the first name of employee, empStatus stores the employee status
                 double  hoursWorked , hourlyRate ;   //hoursWorked to store the no. of hours worked by employee, hourlyRate stores the hourly pay of a employee 
                 while ( true )   //Repeatedly allow the user to make choice until exit is chosen
                 {
                     //Print the menu
                    
                 System . out . println ( "\nEmployee Menu" );
                 System . out . println ( "---------------" );
                 System . out . println ();
                 System . out . println ( "1) Input an employee's information" );
                 System . out . println ( "2) Find an employee by last Name" );
                 System . out . println ( "3) Display employee payroll information - sorted by last name" );
                 System . out . println ( "4) Exit" );
                 System . out . println ();
                 System . out . print ( "Input menu choice: " );
                 try {
                     //Read the input from user
                    choice = Integer . parseInt ( inputReader . nextLine ()); //choice is a variable to take input from the user
                     if (( choice > 4 ) || ( choice < 1 ))   throw   new   NumberFormatException ();   //If user enters a choice not in the list, throw exception
                    
                     }
                 catch ( NumberFormatException  invalidInput )   //Catch the exception if user enters an input not in menu and invalidInput is a instance for the exception
                 {
                     System . out . println ( "Invalid menu selection" );   //Print error message
                 }
                 switch ( choice )   //Based on the users choice, do the corresponding tasks
                 {
                 case   1 :   //If the input is 1, read the employee details
                     System . out . print ( "Input the first name of the employee: " );
                    firstName = inputReader . nextLine ();   //Read the first name of student
                     System . out . print ( "Input the last name of the employee: " );
                    lastName = inputReader . nextLine ();   //Read the last name of student
                     while ( true ) //Read the employee status till a valid input is entered
                     {
                     System . out . print ( "Input 'E' for Exempt or 'N' for Non-Exempt employee:" );
                     try //check if user enters valid input 
                     {
                    empStatus = inputReader . nextLine (); //to read the employee status
                     if ( empStatus . equals ( "E" )) //if user enters  E then prompt the user to enter hourly rate
                     {
                         while ( true ) //Repeatedly allow the user to make choice until exit is chosen
                         {
                             System . out . print ( "Input the hourly rate:" ); //prompting to enter hourly rate
                             try {
                            hourlyRate = Double . parseDouble ( inputReader . nextLine ()); //converting the given data into double 
                             if ( hourlyRate < 0 )   // if the user input is not numeric and negative number throws an exception
                                 throw   new   NumberFormatException ();   //If the input is not between 0 and 100, throw an exception
                             else
                                 break ;
                             }
                             catch ( NumberFormatException  rateError )   //ctach block to catch the exception
                             {
                                 System . out . println ( "Input of hourly rate is invalid" ); //displaying the error message
                             }
                         }
                         new   Employee ( firstName , lastName , empStatus , hourlyRate ); //calling the constructor to add those details to employeeList
                         break ;
                        
                     }
                     else   if ( empStatus . equals ( "N" ))   //if the user input equals to N
                     {
                         while ( true ) //Repeatedly allow the user to make choice until exit is chosen
                         {
                             System . out . print ( "Input the hours worked:" ); //prompting user to enter data
                             try {
                            hoursWorked = Double . parseDouble ( inputReader . nextLine ()); //converting the given data to double
                             if ( hoursWorked < 0 )   // if the input is non numeric and negative value then throws an exception
                                 throw   new   NumberFormatException ();   //If the input is not between 0 and 100, throw an exception
                             else
                                 break ;
                             }
                             catch ( NumberFormatException  rateError ) //block to catch the exception
                             {
                                 System . out . print ( "Input of hours worked is invalid" ); //displaying the error message
                             }
                         }
                         while ( true ) //Repeatedly allow the user to make choice until exit is chosen
                         {
                             System . out . print ( "Input the hourly rate:" ); //displying thr mesg to enter data
                             try {
                            hourlyRate = Double . parseDouble ( inputReader . nextLine ()); //converting the given data into double
                             if ( hourlyRate < 0 ) //if the input is non numeric and negative then throws an exception
                                 throw   new   NumberFormatException ();   //If the input is not between 0 and 100, throw an exception
                             else
                                 break ;
                             }
                             catch ( NumberFormatException  rateError ) //ctach block to catch the exception
                             {
                                 System . out . println ( "Input of hourly rate is invalid" ); //displaying the error message
                             }
                         }
                         new   Employee ( firstName , lastName , empStatus , hoursWorked , hourlyRate ); //calling the Employee class consructor to store the data in the employeeList
                         break ;
                     }
                     else   //if user enters other than E or N then throws an exception
                         throw   new   Exception ();
                     }
                     //catch the exception if the input is not valid
                     catch ( Exception  statusError ) //block to catch the exception
                     {
                         System . out . println ( "Invalid input - Employee status must be typed as a 'E' or 'N'" ); //displaying the erroe message
                     }
                   }
                     break ;
                 case   2 :  
                     // prmpting the user to enter the lant name
                     System . out . print ( "Input the last name you wish to search on:" );
                    lastName = inputReader . nextLine ();
                     //calling the method to search the employee list by last name
                     Employee . getEmployeeByLastName ( lastName );
                     break ;
                 case   3 :   //Call the function to display the employee details
                        printEmployeeDetails ();
                     break ;
                 case   4 :   //Exit from the program
                    inputReader . close ();
                     System . exit ( 0 );
                 }
                 }
             }
             //This method to Sort the employee's by lastName and secondary sort by firstName
             public   static   void  sortEmployee ( ArrayList <?>  employeeList )
             {
                 //Use a loop to traverse through all the students in the list
                 //index is a loop variable used to sort
                 for ( int  index = 0 ; index < employeeList . size (); index ++ )
                 {
                     for ( int  index1 = 0 ; index1 < employeeList . size (); index1 ++ )   //index1 is a loop variable used to sort 
                     {
                         Collections . sort ( employeeList ,   new   Comparator < Object > ()   {   // to sort the arrayList
                             public   int  compare ( Object  o1 ,   Object  o2 )   //compare method to compare the lastNames of students
                             {
                                 Employee  employee1 = ( Employee )  o1 ;   //declaring employee1 object for Employee class
                                 Employee  employee2 = ( Employee )  o2 ;   //declaring employee2 object for Employee class
                                 int  res = employee1 . lastName . compareToIgnoreCase ( employee2 . lastName ); //res variable stores the compared result
                                 if   ( res != 0 )   //if no two students lastNames are same
                                         return  res ;
                                 return  employee1 . firstName . compareToIgnoreCase ( employee2 . firstName );   //if more than one employee lastName is same then compare the firstName
                                
                             }
                         });
                     }
                 }
             }
             //this method prints the employee details
             public   static   void  printEmployeeDetails ()
             {
                sortEmployee ( Employee . employeeList );   //Calling method to sort the employee's by last name 
                 try {
                 if ( Employee . employeeList . size () <= 0 ) //checking the condition whether the array contains elements
                     throw   new   ArrayIndexOutOfBoundsException (); //throwing the new exception
                 }
                 catch ( ArrayIndexOutOfBoundsException   EmptyError ) //EmptyError is a instance for ArrayIndexOfBoundsException class
                 //catch the exception if array contains no elements
                
                 {
                     System . out . println ( "No records have been inputted!" ); //displaying the message
                 }
                 if ( Employee . employeeList . size () > 0 ) //checking the condition to execute the block of code if it trues
                 {
                 //Print the header/ title of the table
                 System . out . println ();
                 System . out . println ( "Employee Payroll Report" );   //Print the report title
                 System . out . println ( "------------------------" );
                 System . out . println ();
                 System . out . print ( "Employee Name" + "\t\t" );
                 System . out . print ( "Status" + "\t\t" );
                 System . out . print ( "Hours Worked\t" );
                 System . out . print ( "Hourly Rate\t" );
                 System . out . print ( "Gross Pay\t" );
                 System . out . print ( "Federal Taxes\t" );
                 System . out . print ( "State Taxes\t" );
                 System . out . print ( "Net Pay" );
                 System . out . println ( "" );
                 for ( int  index = 1 ; index <= 8 ; index ++ )   //index is a loop variable used to print dash lines
                 {
                     if ( index == 5 )
                         System . out . print ( "----------\t" );
                     else   if ( index == 3 )
                         System . out . print ( "------------\t" );
                     else   if ( index == 4 )
                         System . out . print ( "------------\t" );
                     else   if ( index == 1 )
                         System . out . print ( "--------------\t\t" );
                     else   if ( index == 2 )
                         System . out . print ( "------\t\t" );
                     else   if ( index >= 6 && index <= 7 )
                         System . out . print ( "-------------\t" );
                     else
                         System . out . print ( "-------\t" );
                 }
                 System . out . println ( "" );
                 DecimalFormat  dFormat = new   DecimalFormat ( "#.00" ); //declaring the dFormat variable to define the format
                 double  totalGrossPay = 0 ; //stores the totalGrossPay and initializes to zero
                 double  totalFedTaxes = 0 ; //stores the total federal taxes and initializes to zero
                 double  totalStateTaxes = 0 ; //stores the total state taxes and initializes to zero
                 double  totalNetPay = 0 ; //stores the total net pay and initializes to zero
                 //Use a loop to traverse through all the employee's in the list
                 for ( int  index = 0 ; index < Employee . employeeList . size (); index ++ )   //index is a loop variable used to print 
                 {
                     //Take each object in the array list into a currentEmployee object and print the details
                     Employee  currentEmployee = Employee . employeeList . get ( index );
                     System . out . print ( currentEmployee . lastName + ", " + currentEmployee . firstName + "\t" );   //print first name and last name
                     //If the characters in firstname and last name are less than 14, add a tab space
                     if ( currentEmployee . firstName . length () + currentEmployee . lastName . length () < 14 )  
                         System . out . print ( "\t" );
                     //If the characters in first name and last name are less than 6, add another tab space
                     if ( currentEmployee . firstName . length () + currentEmployee . lastName . length () < 6 )
                         System . out . print ( "\t" );      
                     System . out . print ( currentEmployee . empStatus + " " ); //prints the employee status
                     if ( currentEmployee . empStatus . length () < 7 ) //if the statu length is less than 7 then adds a one more tab
                         System . out . print ( "\t" );
                     if ( currentEmployee . empStatus . length () < 14 ) //if the statu length is less than 14 then adds a one more tab
                         System . out . print ( "\t" );
                     System . out . print ( dFormat . format ( currentEmployee . hoursWorked ) + "   \t" ); //prints the hours worked by employee
                     System . out . print ( dFormat . format ( currentEmployee . hourlyRate ) + "  \t\t" ); //prints the employee hourly rate
                     System . out . print ( convertDoubletoCurreny ( currentEmployee . grossPay ) + "\t" ); //prints the gross pay of employee
                     if ( convertDoubletoCurreny ( currentEmployee . grossPay ). length () <= 6 ) //if gross pay length is less than 6 than add a one more tab 
                         System . out . print ( "\t    " );
                     System . out . print ( convertDoubletoCurreny ( currentEmployee . fedTaxes ) + "\t\t" ); //prints the federal taxes
                     System . out . print ( convertDoubletoCurreny ( currentEmployee . stateTaxes ) + "\t\t" ); //prints the state taxes
                     System . out . print ( convertDoubletoCurreny ( currentEmployee . netPay ) + "\t" ); //prints the net pay 
                 System . out . println ( "" );  
                totalGrossPay = totalGrossPay + currentEmployee . grossPay ; //calculating the total gross pay
                totalFedTaxes = totalFedTaxes + currentEmployee . fedTaxes ; //calculating the total federal taxes
                totalStateTaxes = totalStateTaxes + currentEmployee . stateTaxes ; //calculating the total state taxes
                totalNetPay = totalNetPay + currentEmployee . netPay ; //calculating the total net pay
                 }
                 System . out . print ( "\t\t\t\t\t\t\t\t\t---------\t----------\t------------\t-------" ); //printing the dashes
                 System . out . println ( "" );
                
                 System . out . print ( "Totals:\t\t\t\t\t\t\t\t\t" + convertDoubletoCurreny ( totalGrossPay ) + "\t" + convertDoubletoCurreny ( totalFedTaxes ) + "\t\t" + convertDoubletoCurreny ( totalStateTaxes ) + "\t\t" + convertDoubletoCurreny ( totalNetPay )); //printing the total grosspay and taxes net pay
                 }    
             }
         public   static   String  convertDoubletoCurreny ( double   CurrencyAmount ) //method to convert the double to currency 
         {
             DecimalFormat  dFormat = new   DecimalFormat ( "#.00" ); //declaring the dFormat varible to define the format
             String  currencyString = dFormat . format ( CurrencyAmount ); //stores the string format of double value
             String []  currencyStringArray = currencyString . split ( "\\." );   //splitting the string at dot and storing them in the array
             int  currencyInteger = Integer . parseInt ( currencyStringArray [ 0 ]); ////storing the first part of the into the interger variable 
             String  finalCurrencyString = ( NumberFormat . getNumberInstance ( Locale . US ). format ( currencyInteger )) + "." + currencyStringArray [ 1 ]; //converting the integer into currency format
             return  finalCurrencyString ; //returning the final currency string
         }

}