Write a class with name employee and basic. Find the gross pay of an employee for the following allowances and deductions.Print name ,basic pay, net pay and gross pay . Dearness Allowance=25%*Basic Pay House Rent Allowance =15%*Basic Pay Provident fund=8.33%*Basic Pay Net Pay=Basic Pay + Dearness Allowance +House Rent Allowance Gross Pay=Net Pay-Provident Fund
import java.util.*;
class employeeandbasic
{
public static void main()
{ Scanner Sc=new Scanner(System.in);
System.out.println(“Enter name and basic pay”);
double basic=Sc.nextDouble();
String name=Sc.nextLine();
{
double DA=0.25*basic;
double HRA=0.15*basic;
double PF=8.33*Basic;
double NP=basic+ DA+ HRA+PF;
double GP=NP-PF;
{ System.out.println(“The name is : ”+name); }
{ System.out.println(“The basic pay: “+basic); }
{ System.out.println(“The net pay: “+NP); }
{System.out.println(“The gross pay: “+GP);
}}}
Output:
Enter name and basic pay
James Vince 1000
The name is : James Vince
The basic pay is : 1000
The net pay is : 9730
The gross pay is :1400
class employeeandbasic
{
public static void main()
{ Scanner Sc=new Scanner(System.in);
System.out.println(“Enter name and basic pay”);
double basic=Sc.nextDouble();
String name=Sc.nextLine();
{
double DA=0.25*basic;
double HRA=0.15*basic;
double PF=8.33*Basic;
double NP=basic+ DA+ HRA+PF;
double GP=NP-PF;
{ System.out.println(“The name is : ”+name); }
{ System.out.println(“The basic pay: “+basic); }
{ System.out.println(“The net pay: “+NP); }
{System.out.println(“The gross pay: “+GP);
}}}
Output:
Enter name and basic pay
James Vince 1000
The name is : James Vince
The basic pay is : 1000
The net pay is : 9730
The gross pay is :1400
where's the output?
ReplyDeleteRun the program in bluej. You'll get the output.
ReplyDeletecan you give he flow chart for this program and algorithm also by this month end please?
ReplyDeletecan you give he flow chart for this program and algorithm also by this month end please?
ReplyDeleteV Sai@17... Ping me personally in Google+ or in gmail.
ReplyDeleteis it runnable in editplus
ReplyDeleteNo. It's a JAVA program. You have to run it in BlueJ software.
ReplyDeleteCAN u do parameter constructor
ReplyDeleteyeah. but later on.
ReplyDelete