0% found this document useful (0 votes)
20 views4 pages

Private Void Btn1Actionperformed (Java - Awt.Event - Actionevent Evt) (

The document contains code that calculates totals for food and drink items ordered. It parses integers from text fields for quantities of 10 items, calculates subtotals by multiplying quantity by price, and totals meal and drink subtotals. It then outputs the item names, quantities, and prices into separate text fields conditioned on the quantity of each item being greater than 0.

Uploaded by

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

Private Void Btn1Actionperformed (Java - Awt.Event - Actionevent Evt) (

The document contains code that calculates totals for food and drink items ordered. It parses integers from text fields for quantities of 10 items, calculates subtotals by multiplying quantity by price, and totals meal and drink subtotals. It then outputs the item names, quantities, and prices into separate text fields conditioned on the quantity of each item being greater than 0.

Uploaded by

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

private void btn1ActionPerformed(java.awt.event.

ActionEvent evt) {

int a=Integer.parseInt(m1.getText());

int b=Integer.parseInt(m2.getText());

int c=Integer.parseInt(m3.getText());

int d=Integer.parseInt(m4.getText());

int e=Integer.parseInt(m5.getText());

int f=Integer.parseInt(m6.getText());

int g=Integer.parseInt(m7.getText());

int h=Integer.parseInt(m8.getText());

int i=Integer.parseInt(m9.getText());

int j=Integer.parseInt(m10.getText());

double mtotal=a*45+b*60+c*50+d*110+e*40;

double dtotal=f*30+g*100+h*30+i*20+j*40;

ml1.setText(mtotal+" ");

d1.setText(dtotal+" ");

tl.setText(mtotal+dtotal+" ");

if(a!=0)

item1.setText("Burger");

qty1.setText(a+" ");

p1.setText((a*45)+" ");

if(b!=0)

item2.setText("Pasta(W)");

qty2.setText(b+" ");

p2.setText((b*60)+" ");

}
if(c!=0)

item3.setText("Wedges");

qty3.setText(c+" ");

p3.setText((c*50)+" ");

if(d!=0)

item4.setText("Pizza");

qty4.setText(d+" ");

p4.setText((d*110)+" ");

if(e!=0)

item5.setText("Fries");

qty5.setText(e+" ");

p5.setText((e*40)+" ");

if(f!=0)

item6.setText("Coke");

qty6.setText(f+" ");

p6.setText((f*30)+" ");

if(g!=0)

item7.setText("Shake");
qty7.setText(g+" ");

p7.setText((g*100)+" ");

if(h!=0)

tttl.setText("Sprite");

qty8.setText(h+" ");

p8.setText((h*30)+" ");

if(i!=0)

item9.setText("Bournvita");

qty9.setText(i+" ");

p9.setText((i*20)+" ");

if(j!=0)

item10.setText("Slice");

qty10.setText(j+" ");

p10.setText((j*40)+" ");

ttlpr.setText((mtotal+dtotal)+" ");

You might also like