Students Result in JAVA NETBEANS IDE 6.5.1

Q15. Design an application in JAVA NETBEANS IDE 6.5.1 to prepare students result on the basis of marks entered.

Sol:

Create a GUI application as per following screenshot.

 

Type the following code by double clicking  jButton1 , button, below the line that says, ‘// TODO add your handling code here’

jTextField1.setText(“”);

jTextField2.setText(“”);

jTextField3.setText(“”);

jTextField4.setText(“”);

jTextField5.setText(“”);

jTextField6.setText(“”);

jTextField7.setText(“”);

jTextField8.setText(“”);

jTextField9.setText(“”);

jTextField10.setText(“”);

}

Type the following code by double clicking  jButton2 , button, below the line that says, ‘// TODO add your handling code here’

double eng,acc,bst,ip,eco,per,total;

eng=Double.parseDouble(jTextField3.getText());

acc=Double.parseDouble(jTextField4.getText());

bst=Double.parseDouble(jTextField5.getText());

ip=Double.parseDouble(jTextField6.getText());

eco=Double.parseDouble(jTextField7.getText());

total=eng+acc+bst+ip+eco;

jTextField8.setText(total+””);

per=(total/500)*100;

jTextField9.setText(per+””);

if(90<=per)

jTextField10.setText(“A+”);

else if(80<=per)

jTextField10.setText(“A”);

else if(70<=per)

jTextField10.setText(“B+”);

else if(60<=per)

jTextField10.setText(“B”);

else if(50<=per)

jTextField10.setText(“C+”);

else if(40<=per)

jTextField10.setText(“C”);

else if(36<=per)

jTextField10.setText(“D”);

else

jTextField10.setText(“Fail”);

}

 

Type the following code by double clicking  jButton3 , button, below the line that says, ‘// TODO add your handling code here’

System.exit(0);

}

Output:     

 

Leave a Reply

Your email address will not be published. Required fields are marked *