Java program to design discount and marks calculator

Contents

In this program students can learn how to code a JAVA IDE COMBINED  DISCOUNT AND MARKS (PERCENTAGE) CALCULATOR.Suitable for class 11 and 12 INFORMATIC PRACTICES students.

The frame form contains a no. of different fields for different purposes with 2 different panels. In this form you can calculate the discount on the festival and non-festival days and also you can find out the percentage marks according to the stream ie. medical and non-medical that students opt in the school.

Also Read:- Top 10 Headphones Under 100 Dollars ($)

Given below is the code for the java frame form :-

private void button1ActionPerformed(java.awt.event.ActionEvent evt) {
int price=Integer.parseInt(text1.getText());
int qty=Integer.parseInt(text2.getText());
double amt=price*qty;
double dis=0;
double net;
if(rb1.isSelected())
dis=0.2*amt;
else if(rb2.isSelected())
dis=0.1*amt;
text3.setText(“”+dis);
net =amt-dis;
text4.setText(“”+net);

}

private void button2ActionPerformed(java.awt.event.ActionEvent evt) {
int f=Integer.parseInt(text12.getText());
int s=Integer.parseInt(text123.getText());
double per=f*s/200*100;
text1234.setText(“”+per);
if(rb3.isSelected())
if(per>=80)
text12345.setText(“A”);
else if(per>=70 && per<80)
text12345.setText(“B”);

else if(per>=60 && per<70)
text12345.setText(“C”);
else
text12345.setText(“D”);
if(rb4.isSelected())
if(per>=90)
text12345.setText(“A”);
else if(per>=80 && per<90)
text12345.setText(“B”);

else if(per>=70 && per<80)
text12345.setText(“C”);
else
text12345.setText(“D”);
}

 

This was the article on building a JAVA IDE PROGRAMME” FESTIVAL AND NON-FESTIVAL'” AND “DISCOUNT” CALCULATOR. Hope you guys like the content and get maximum help from this article. feel free to contact us if you have any queries regarding this article.

2 Comments

1 Trackback / Pingback

  1. learn Java Programming With These Programs. - Latest Stuff Updates

Leave a Reply

Your email address will not be published.


*