Computer Science, asked by Omprasad1234567890, 4 months ago

Write a program in Java to input the name and basic salary of an
employee. Calculate and display the gross salary and net salan
when:
da= 30% of basic
hra= 12.5% of basic
pf= 10% of basic
gross= basic + da + hra
net pay = gross - pf

using scanner class only

no spam

it's urgent please give fast​

Answers

Answered by anindyaadhikari13
2

Answer:-

This is the required program.

import java.util.*;

class Program

{

public static void main()

{

double basic, da, hra, pf, gross, net_pay;

Scanner sc=new Scanner(System.in);

System.out.print("Enter the basic salary: ");

basic=sc.nextDouble();

da=30/100.0*basic;

hra=12.5/100.0*basic;

pf=10/100.0*basic;

gross=basic+da+hra;

net_pay=gross-pf;

System.out.println("Gross salary: "+gross);

System.out.println("Net salary: "+net_pay);

}

}

Answered by DevilHunter001
1

Answer:

Answer:-

This is the required program.

import java.util.*;

class Program

{

public static void main()

{

double basic, da, hra, pf, gross, net_pay;

Scanner sc=new Scanner(System.in);

System.out.print("Enter the basic salary: ");

basic=sc.nextDouble();

da=30/100.0*basic;

hra=12.5/100.0*basic;

pf=10/100.0*basic;

gross=basic+da+hra;

net_pay=gross-pf;

System.out.println("Gross salary: "+gross);

System.out.println("Net salary: "+net_pay);

}

}

Similar questions