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

9 comments:

  1. Run the program in bluej. You'll get the output.

    ReplyDelete
  2. can you give he flow chart for this program and algorithm also by this month end please?

    ReplyDelete
  3. can you give he flow chart for this program and algorithm also by this month end please?

    ReplyDelete
  4. V Sai@17... Ping me personally in Google+ or in gmail.

    ReplyDelete
  5. No. It's a JAVA program. You have to run it in BlueJ software.

    ReplyDelete
  6. CAN u do parameter constructor

    ReplyDelete

Powered by Blogger.