Multipliing a double value with the result of dividing of two shorts
<p>The aim of my programm is to show the salary for an Employee (Coder of Manager) depending of how many hours this employee worked in a month.The array containing  3 of employees go to Accountant as a parameter.Accountant return salary of every employee.
Salary of Coder and of Manager is calculated in different ways.</p>

<p>Here is my Java code:</p>

<pre><code>    public class OOP
    {  
       public static void main(String[] args)
       {  
    // fill the staff array with three Employee objects.


    Employee[] staff = new Employee[3];

    staff[0] = new Manager("Carl Cracker",75000.00,(short)160);
    staff[1] = new Coder("Harry Hacker", 50000.00,(short)165);
    staff[2] = new Coder("Tony Tester", 40000.00,(short)200);

    Accountant Counter = new Accountant();
    Counter.printSalary(staff, (byte)2);

       }
    }

    abstract class Employee
    {  
       public Employee(String n, double w, short h)
    {  
      name = n;

      wageRate = w;

      workedHours = h;

    }

     public String getName()
     {
         return name;
     }

     public double getSalary(short workingHours)
     {

        this.salary = this.wageRate * (this.workedHours/workingHours);
        return salary;
     }

     private String name;
     protected double wageRate;
     protected short workedHours;
     protected double salary;
    }
    class Coder extends Employee
    {
        public Coder (String n, double w, short h)
        {
            super( n,  w,  h);
        }

        public double getSalary(short workingHours)
        {
            return super.getSalary(workingHours);
        }
    }
    class  Manager extends Employee
    {
        public Manager (String n, double w, short h)
        {
            super( n,  w,  h);
        }
        public double getSalary(short workingHours)
        {
            if (workingHours &gt; workedHours)
            return  super.getSalary(workingHours)*0.7;
            else
                {
                   salary = wageRate;
                   return salary;
                }


         }
     }
    class Accountant
    {
        public Accountant ()
        {
        }
        public void printSalary(Employee[] emp, byte monthInd)
        {
            Employee[] workers = emp;
            byte MID = monthInd;
            MID = (byte) (MID - 1);
            for (Employee worker : workers)
                {
                    System.out.printf("%s's salary this month is %8.2f",worker.getName(), worker.getSalary(workingHours[MID]));
                    System.out.println();
                }
        }

        private short[] workingHours = new short[]{168,160,160,172,162,154,184,168,168,184,168,172};
     }
</code></pre>

<p>Expected result: </p>

<p>Carl Cracker's salary this month is 75000</p>

<p>Harry Hacker's salary this month is 51562.5</p>

<p>Tony Tester's salary this month is 50000</p>

<p>Actual result:</p>

<p>Carl Cracker's salary this month is 75000,00</p>

<p>Harry Hacker's salary this month is 50000,00</p>

<p>Tony Tester's salary this month is 40000,00</p>

<p>Could please somebody explain me why?</p>
