Computer Science, asked by Chhama, 3 months ago

please answer in java language​

Attachments:

Answers

Answered by anindyaadhikari13
4

Required Answer:-

Question:

  • Write a program to calculate the net salary of an employee.

Solution:

Here is the program.

  1. import java.util.*;
  2. public class NetSalary {
  3. public static void main(String[] args) {
  4. Scanner sc=new Scanner(System.in);
  5. double basic, da, hra, cta, pf;
  6. double epf, gross, net=0;
  7. System.out.print("Enter basic: ");
  8. basic=sc.nextDouble();
  9. sc.close();
  10. da=basic*40.0/100.0;
  11. hra=basic*10.0/100.0;
  12. cta=basic*5.0/100.0;
  13. pf=basic*8.33/100.0;
  14. epf=basic*1.67/100.0;
  15. gross=basic+da+hra+cta;
  16. net=gross-(pf+epf);
  17. System.out.println("Net Salary: "+net);
  18. }
  19. }

Explanation:

  • Formula to calculate net salary is given. Using the formula, the program is Solved.

Output is attached.

Attachments:
Similar questions