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

Java Double Parsing in Order Calculation

This Java code defines an ordering application with classes to handle different order items, calculate subtotals and totals, apply taxes, and generate a receipt. It allows the user to select different food items, specify quantities, calculates costs, applies a 12% tax rate, and outputs an itemized receipt with order details, payment mode, and final total. Various action events and methods are used to update values and texts fields as the user interacts with the form controls.

Uploaded by

Edwin Lapat
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)
102 views3 pages

Java Double Parsing in Order Calculation

This Java code defines an ordering application with classes to handle different order items, calculate subtotals and totals, apply taxes, and generate a receipt. It allows the user to select different food items, specify quantities, calculates costs, applies a 12% tax rate, and outputs an itemized receipt with order details, payment mode, and final total. Various action events and methods are used to update values and texts fields as the user interacts with the form controls.

Uploaded by

Edwin Lapat
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

import [Link].

Date;

public class ordring extends [Link] {

Double price1=12.50;
Double price2=18.50;
Double price3=20.40;
String productname1, mode,productname2,productname3;

private void radiocreditcardActionPerformed([Link] evt) {


if([Link]())
mode="CASH";
[Link](false);
}

private void chkorder1ActionPerformed([Link] evt) {

if([Link]())
[Link](true);
productname1 ="SPAGGETI";

private void chkorder2ActionPerformed([Link] evt) {


if([Link]())
[Link](true);
productname2 ="PANCIT";
}

private void chkorder3ActionPerformed([Link] evt) {


if([Link]())
[Link](true);
productname3 ="BIHON";
}

private void btncomputeActionPerformed([Link] evt) {


double qty1= [Link]([Link]());
double qty2= [Link]([Link]());
double qty3= [Link]([Link]());

double taxrate=.12;

String purchase1=[Link](price1*qty1);
[Link](purchase1);
String purchase2=[Link](price2*qty2);
[Link](purchase2);
String purchase3=[Link](price3*qty3);
[Link](purchase3);

double purchase1a=[Link]([Link]());
double purchase2a=[Link]([Link]());
double purchase3a=[Link]([Link]());

String Subtotalall=[Link](purchase1a+purchase2a+purchase3a);
[Link](Subtotalall);

double SubtotalallA=[Link]([Link]());

String Tax=[Link](SubtotalallA*taxrate);
[Link](Tax);

double total=[Link]([Link]());
double tax1=[Link]([Link]());

String NetAmount=[Link](total-tax1);
[Link](NetAmount);

private void btnprintActionPerformed([Link] evt) {

[Link]("***************************************\n");
[Link]([Link]()+"****** RECEIPT *****\n");
[Link]([Link]()+"*********************************\n");
Date obj= new Date();
String date = [Link]();
[Link]("\n"+date+"\n");
[Link]("\n"+"Name:"+[Link]());
[Link]("\n"+"MODE of Payment:"+mode+"\n");
[Link]("\n"+"\t"+"QTY"+"\t"+"PRICE"+"\t"+"AMOUNT"+"\n");

[Link]("\n"+productname1+"\t"+[Link]()+"\t"+[Link]()+"\t"+subtotal
[Link]()+"\n");

[Link]("\n"+productname2+"\t"+[Link]()+"\t"+[Link]()+"\t"+subtotal
[Link]()+"\n");

[Link]("\n"+productname3+"\t"+[Link]()+"\t"+[Link]()+"\t"+subtota
[Link]()+"\n");

You might also like