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
+1 vote
3.9k 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:

After selecting appropriate Radio Button, when 'Commission' button is clicked, commission should be displayed in the respective text field as each Salesman will get a commission based on the units sold according to the following criteria:

Unit Sold Commission(in Rs)
1 to 20 500
20 to 40 1000
>40 2000

1 Answer

+2 votes
by (69.0k points)
selected by
 
Best answer

Code to calculate and display commission:

int com = 0;

if(jRadioButton1.isSelected())

com = 500;

else if(jRadioButton2.isselected())

com = 1000;

else if(jRadioButton3.isSelected())

com = 2000;

iTextField3.setText("" + com);

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

...