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

Ms. Priya works as a programmer in "Avon Education" where she has designed a software to compute fee charges to be paid by the students. A screenshot of the same is shown below :

  • Name of the student is entered by the user.
  • Any one Course out of Pharmacy, Architecture and Arts & Design is chosen by the user.
  • If the student is eligible for Concession, the required checkbox is selected by the user.
  • Based on the course selected, Fee Per Quarter is displayed in the appropriate textfield according to the following criterion :
Course Fee Per Quarter
Pharmacy 2000.00
Architecture  2500.00
Arts & Design 2300.00
  • If the student is eligible for Concession, a concession of 7% of Fee per quarter is calculated as the concession amount, otherwise concession amount is 0.
  • Fee to be paid is the Fee per quarter with the concession amount (if any) deducted from it. Help Ms. Priya in writing the code to do the following :

(i) When 'Calculate Charges' button is clicked, 'Fee per quarter', 'Concession Amount', 'Fee to be Paid' should be calculated and displayed in the respective text fields.

(ii) When 'CLEAR' button is clicked, all the textfields, radiobuttons and checkbox should be cleared.

(iii) When 'Exit' button is clicked the application should close.

1 Answer

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

// Calculation of Amount

double feeperqtr = 0.0,concess = 0.0,feetopay=0.0;

if (jRadioButton1.isSelected())

feeperqtr=2000;

else if (jRadioButton2.isSelected())

feeperqtr=2500;

else if (jRadioButton3.isSelected())

feeperqtr=2300;

if (jCheckBox1.isSelected())

concess= (0.07*feeperqtr);

feetopay=feeperqtr-concess;

jTextField2.setText("" + feeperqtr);

jTextField3.setText(" " + concess);

jTextField4.setText(" " + feetopay);

(ii)  jTextField1.setText(" ");

jTextField2.setText(" ");

jTextField3.setText(" ");

jTextField4.setText(""); 

jRadioButton1.setSelected(false); 

jRadioButton2.setSelected(false); 

jRadioButton3.setSelected(false); 

jCheckBox1.setSelected(false);

system.exit(0)

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

...