Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
23.1k views
in Computer by (73.2k points)

Write a class with name employee and basic as its data members, to find the gross pay of an employee of the following allowances and deductions 

DA = 25% of basic pay

HRA = 15% of basic pay

PF = 8.33% of basic pay

Net Pay = Basic pay + DA + HRA

Gross Pay = Net Pay – PF

1 Answer

+1 vote
by (69.2k points)
selected by
 
Best answer

import jave.i0.*; 

public class employee

{

public static void main (string args [ ]) throws IO Exception

{

int basic; double bra da, pf, n pay,gross;

gross = 0

Input Stream Reader read = new Input Stream Reader (System.in);

Buffered Reader in = new Buffered Reader (read); 

System.out.printIn (“Enter basic salary”);

basic = Integer.parseInt (in.read Line ( ));

da = basic * 25/100

hra = basic * 15/100

pf = basic * 8.33/100;

npay = da + hra + basics; gross = npay – pf; 

System.out.printIn (“The net pay =” + npay); 

System.out.printIn (“The gross pay =” + gross);

}

}

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...