Java Netbeans GUI application to find out the division of student.

Q9. Design a Java Netbeans GUI application to find out the division of student.

Criteria Table

Percentage Division
60-100 First Division
48-60 Second Division
36-48 Third Division
1-36 Fail

 Sol:

Create a GUI application as per following screenshot.

 

 

 

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

float per;

per=Float.parseFloat(txtper.getText());

if(per>=60 && per<=100)

lbldiv.setText(“First Division”);

 

else if(per>=48)

lbldiv.setText(“Second Division”);

else if(per>=36)

lbldiv.setText(“Third Division”);

else

lbldiv.setText(“Fail”);

 

 

}

OUTPUT:

Leave a Reply

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