0% found this document useful (0 votes)
129 views1 page

Java Program for Billing System

The program prompts the user to input a purchaser's name, item code, quantity purchased, and payment code. Based on the item code, it determines the item type and unit price. It then calculates the gross bill, additional charges if paying by check, and net bill to display to the user.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
129 views1 page

Java Program for Billing System

The program prompts the user to input a purchaser's name, item code, quantity purchased, and payment code. Based on the item code, it determines the item type and unit price. It then calculates the gross bill, additional charges if paying by check, and net bill to display to the user.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

public static void main(String[]arg){

String sname,pt="",ses="";
int icode,qp;
double pct=0,pc,ac,nb,up = 0,gb;

[Link]("");
Scanner in = new Scanner([Link]);
[Link]("Purchaser Name : ");
sname = [Link]();
[Link]("Item Code (15-65) : ");
icode = [Link]();

if (icode <=36) {ses="Hakata Printer" ;up = 6560.50;}


if (icode >=50) {ses="Atami System Unit";up= 9365.50;}
if (icode >=58 ) {ses="Hakata Monitor";up= 5500.43;}
if (icode >=59 ) {ses="Hakone Keyboard";up= 3678.99;}

[Link]("Qty Pruchase (2-50) : ");


qp = [Link]();

[Link]("Payment Code (1/2) : ");

pc = [Link]();
if (pc==1) { pt="cash"; pct=0; }
if (pc==2) { pt="check"; pct=10; }

gb=qp*up;
ac=gb*pct/100;
nb=gb+ac;

[Link]("");
[Link]("Purchaser Name : " +sname);
[Link]("Item Type : " +ses);
[Link]("Payment Type : " +pt);
[Link]("Net Bill : " +nb);

}
}

You might also like