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
1.2k views
in Computer by (75.2k points)

Mr. Pawan works as a Programmer in "ABC Marketing Company" where he has designed a Salary generator software to generate the salary of salesman in which Name and Salary are entered by the user. A screenshot of the same is shown below :

Help him in writing the code to do the following:

Money will be deducted from the Gross Salary according to the facilities opted by the employee. When 'Net Salary' button is clicked, Net Salary should be calculated and displayed in the respective text field as per the given formulae: 

Net Salary = Gross Salary - Deductions

1 Answer

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

Code to calculate and display the Net Salary

int amt,extra;

amt = Integer.parseInt(jTextField4.getText());

extra = Integer.parseInt(jTextField5.getText());

jTextField6.setText(" " + (amt-extra));

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

...