Friday, February 14, 2020

Enter employee salary and find monthly and year salary.

import java.util.Scanner;
public class EmployeeSalary
{
            public void emplo(int a,int b)
        {
            System.out.println( "Monthly earning:"+a);
            System.out.println("Monthly expence:" + b);
                int c;int d;
c=a-b;
d=c*12;
System.out.println("Monthly Slalary:  "+c);
System.out.println("Yearly Salary: "+d );
}
   
    public static void main(String[] args)
        {
            Scanner sc=new Scanner(System.in);
            EmployeeSalary  es=new EmployeeSalary();
            System.out.println("monthly earning:");
            int a=sc.nextInt();
            System.out.println("monthly expence:");
            int b=sc.nextInt();
            sc.close ();
            es.emplo(a, b);
        }
}

No comments:

Post a Comment