Page 23 - IP
P. 23
CBSE AISSCE 2018 Marking Scheme for Informatics Practices
(Sub Code: 065 Paper Code 90)
● 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’, 4
‘Fee to be Paid’ should be calculated and displayed in the respective text fields.
Ans // Calculation of Amount
(i) 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);
(½ mark for correct use of if statement for Radiobutton)
(½ mark for assigning correct value for Fee per Quarter)
(½ mark for correct use of if statement for Checkbox)
(½ mark for calculating concession)
(½ mark for calculating Fee to be paid)
(½ mark for displaying Fee per Quarter)
(½ mark for displaying concession)
(½ mark for displaying Fee to be paid)
(ii) When ‘CLEAR’ button is clicked, all the textfields, radiobuttons and checkbox 1
should be cleared.
Ans jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jTextField4.setText("");
jRadioButton1.setSelected(false);
jRadioButton2.setSelected(false);
jRadioButton3.setSelected(false);
jCheckBox1.setSelected(false);
( ½ mark for clearing any text field)
( ½ mark for clearing check box/radiobutton)
Note : NULL in place of “” should be accepted for clearing text field.
(iii) When ‘Exit’ button is clicked, the application should close. 1
System.exit(0);
(1 mark for correct answer)
Page 8 of 13