PHP5, PHP/JavaBridge & amp; ApacheonXPPRO + SP2and

Source: Internet
Author: User
Example

Example-SalesTax. java, salestax. php, salestax.htm C: \ Program Files \ Apache Group \ Apache2 \ htdocs \ test \ SalesTax. java. import java. util. *; import java. text. *; public class SalesTax {private double tax = 0.0; private double price = 0.0; private

Example-SalesTax. java, salestax. php, salestax.htm

C: \ Program Files \ Apache Group \ Apache2 \ htdocs \ test \ SalesTax. java.

import java.util.*;import java.text.*;public class SalesTax{    private double tax = 0.0;    private double price = 0.0;    private double salesTax = 0.0;    public SalesTax()    {}    public String SalesTax(double price, double salesTax)    {        tax = price * salesTax;        NumberFormat nf = null;        nf = NumberFormat.getCurrencyInstance();        String priceOut = nf.format(price);        String taxOut = nf.format(tax);        nf = NumberFormat.getPercentInstance();        String salesTaxOut = nf.format(salesTax);        String str = "Sales Tax of " + salesTaxOut +            " on " + priceOut + " equals " + taxOut + ".";        return str;    }}

C: \ Program Files \ Apache Group \ Apache2 \ htdocs \ test \ salestax. php

 SalesTax($price, $tax);}?>

C: \ Program Files \ Apache Group \ Apache2 \ htdocs \ test \ salestax.htm.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.