9/22/10



"Computing the NetBill (Java Code)"

9/22/2010

import javax.swing.JOptionPane;


public class CustomersNetBill{


public static void main(String[] args){


String inputGrossBill = "";
double grossBill, serviceCharge = 0, salesTax = 0, change = 0, netBill = 0;
String inputAmount = "";
double amount = 0;




inputGrossBill = JOptionPane.showInputDialog("Enter the gross bill of the customer: ");
grossBill = Double.parseDouble(inputGrossBill);


serviceCharge = grossBill * 0.12;
salesTax = grossBill * 0.07;


netBill = serviceCharge + salesTax + grossBill;


inputAmount = JOptionPane.showInputDialog("Enter amount given by the customer: ");
amount = Double.parseDouble(inputAmount);


change = amount - netBill;


JOptionPane.showMessageDialog(null, "\n\t" + "PROGRAMMER: Andy F. Go\n\t"
+ "BSCS (II-A)\n\t" + "DATE: July 30, 2010\n\n\t"
+ "ARTURO's PIZZA PARLOR\n\n Here is your official receipt:\n\n"
+ "Gross Bill:\t\t" + grossBill + "\n"
+ "Service Charge:\t\t" + serviceCharge + "\n"
+ "Sales Tax:\t\t" + salesTax + "\n"
+ "Customer's Net Bill:\t\t" + netBill + "\n\n"
+ "Cash:\t\t" + amount + "\n"
+ "Change:\t\t" + change


+ "\n\nThank You. Come Again!!!\n"
+ "Cashier : Ms. Crisostomo\n"
+ "Bagger : Sir Ong");


System.exit(0);
}


}



Your thoughts about this post? Leave a commment now.

Posted by

AndyFGo : A place for Pinoy Music News. Lyrics. Music Videos. Pinoy Movie/Foreign Trailers. OPM.

 

© 2013 andyfgo. All rights reserved. Designed by Templateism. Powered by Blogger
Protected by Copyscape DMCA Takedown Notice Violation Search

Back To Top