0 votes
in Information Technology by (47.6k points)
closed by

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 :
CourseFee per Quarter
Arts & Design2300.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:

1. 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. 

2. When ‘CLEAR’ button is clicked, all the textfields, radiobuttons and checkbox should be cleared. 

3. When ‘Exit1 button is clicked, the application should close.

1 Answer

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


Name is stored in jTextField1 

Fee Per Quarter is stored in jTextField2 

Concession Amount is stored in jTextField3 

Fee to be Paid is stored in jTextField4

(i) We need to double click at the ‘Calculate Charges’ button (jButtonl) and type the following code ; 

int Fee_per_quar,

concession_amount ; 

float fee_tobe_paid ; 

String name = jTextFieldl. getText ( ) ; 

if (jRadioButtonl. isSelected ( ) = =True) 

Fee_per_quar = 2000 ;

else if (jRadioButton2. isSelectedO == True) Fee_per_quar = 2500 : 

else if (jRadioButton3. is Selected ( ) == True)

Fee_per_quar = 2300 ; 


Fee, per_quar = 0 ; 

jTextField2. setText (Fee_per_quar) ; 

if (jCheckBox. isSelected ( ) = =True) 

concession_amount = (Fee__per_quar * 7) / 100 ; 


concession_amount = 0 ; 

JTextField3. setText

(concession_amount) ;

fee_tobe_paid = Fee_per_quar - concession_amount ; 

jTextField4. setText (fee_tobe_paid) ; 

(ii) We need to double click at the ‘Clear’ button (jButton2) and type the following code : 

jTextFieldl. setText (" ") ; 

jTextField2. setText (" ") ; 

jTextField3. setText (" ") ; 

jTextField4. setText (" ") ; 

jRadioButton1. setSelected (False) ; jRadioButton2. setSelected (False); jRadioButton3. setSelected (False) ; jCheckBox. setSelected (False) ; 

(iii) We need to double click at the ‘Exit’ button (jButton3) and type the following code: 

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.