You are on page 1of 2

import java.util.

Scanner;

/*
* To change this license header, choose License Headers in Project
Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author pc
*/
public class OnlinePOS {
public static void main(String[] args) {
String customer_name;
Double p_item, quantity, shipping, t_cost, sub_total, tax,
t_amount;

Scanner in = new Scanner(System.in);

System.out.println("Customer Name:");
customer_name = in.nextLine();
System.out.println("Price of Item:");
p_item = in.nextDouble();
System.out.println("Quantity:");
quantity = in.nextDouble();
System.out.println("Shipping Fee:");
shipping = in.nextDouble();

double minimum_fee = 165;

if (quantity >=51 && quantity <= 30) {


shipping = minimum_fee + 350;
}
else if (quantity >= 31 && quantity <= 50){
shipping = minimum_fee + 250;
}
else if (quantity >= 21 && quantity <= 30){
shipping = minimum_fee + 150;
}
else if (quantity >= 11 && quantity <= 20){
shipping = minimum_fee + 90;
}
else {
shipping = minimum_fee + 0;
}

sub_total = p_item * quantity;


t_cost = sub_total + shipping;
tax = t_cost * 0.12;
t_amount = t_cost + tax;

System.out.println("Customer's Name: " + customer_name);


System.out.println("Price of Item: " + p_item);
System.out.println("Quantity: " + quantity);
System.out.println("Shipping Fee: " + shipping);
System.out.println("Sub Total: " + sub_total);
System.out.println("Total Cost of an Item: " + t_cost);
System.out.println("Tax: " + tax);
System.out.println("Total Amount : " + t_amount);

}
}

You might also like