0% found this document useful (0 votes)
17 views3 pages

Q.Design An Application in Java To Calculate The Discount Asper The Mode of Payment Is Given

This application calculates product discounts in Java based on the payment method selected. The user enters the product name, quantity, and rate, and the application calculates the amount. It then determines the discount percentage based on whether silver, gold, or cash payment was chosen, applies the discount of 3%, 5%, or 10% respectively, and displays the amount, discount, and net amount to the user.

Uploaded by

rohit mourya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views3 pages

Q.Design An Application in Java To Calculate The Discount Asper The Mode of Payment Is Given

This application calculates product discounts in Java based on the payment method selected. The user enters the product name, quantity, and rate, and the application calculates the amount. It then determines the discount percentage based on whether silver, gold, or cash payment was chosen, applies the discount of 3%, 5%, or 10% respectively, and displays the amount, discount, and net amount to the user.

Uploaded by

rohit mourya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

​APPLICATION -6

Q.Design an application in java to calculate the discount asper the mode of payment is given

private void button1ActionPerformed(java.awt.event.ActionEventevt) {

String x = tfpro.getText();

int qua = Integer.parseInt(tfquan.getText());

int rate = Integer.parseInt(tfra.getText());

intamt = qua * rate ;

int disc ;

if (rbsil.isSelected())

disc = amt * 3/100 ;

else if (rbgold.isSelected())

disc = amt * 5/100 ;

else

disc = amt *10/100 ;

int net = amt - disc;

tfdisc.setText(" "+disc);

tfnet.setText(" "+net);

tfamt.setText(" "+amt);

// TODO add your handling code here:

private void button2ActionPerformed(java.awt.event.ActionEventevt) {

System.exit(0); // TODO add your handling code here:

}
DESIGN WINDOW

You might also like