Home »
» price calculation
price calculation
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
public class FinalPrice{
private static double percent_markedup= 25;
private static double original_price = 100;
private static double sales_tax_rate = 2;
public void calculatePrice(){
double storeSalPrice = original_price*percent_markedup/100;
double tempSalPrice = original_price+storeSalPrice;
double tempTaxPrice = tempSalPrice*sales_tax_rate/100;
double taxSalPrice = tempSalPrice+tempTaxPrice;
double finalPrice = tempSalPrice+tempTaxPrice;
System.out.println("The original price="+original_price);
System.out.println("The markedup percentage="+percent_markedup);
System.out.println("The store Selling price="+tempSalPrice);
System.out.println("The sales tax rate="+ sales_tax_rate);
System.out.println("The sales tax price="+ tempTaxPrice);
System.out.println("The final Price="+ finalPrice);
}
public static void main(String args[]){
FinalPrice finalPrice = new FinalPrice();
finalPrice.calculatePrice();
}
}
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">