Computer Science, asked by stager94, 1 year ago

Write a program in JAVA to input name and basic salary of an employee. Calculate and display the gross salary and net salary when:

da=30% of basic

hra=12.5% of basic

pf=10% of basic

gross=basic+da+hra

net pay=gross-pf

Answers

Answered by Anonymous
14

//a program to calculate gross salary and net salary

import java.util.*;

public class Esalary

{

public static void main(string args[])

{

Scanner in = new Scanner(System.in);

int basic;

double da,hra,pf,gp=0,np=0;

String name;

System.out.println("Enter the name of the employee");

name=in.nextInt();

da=basic*30/100;

hra=basic*12.5/100;

pf=basic*10/100;

gp=basic+da+hra;

np=gp-pf;

System.out.println(Employee's Name:"+name);

System.out.println("Gross pay :Rs." +gp);

System.out.println.("Net pay :Rs." +np);

}

}

Similar questions