//Executes the package statement.
package storeapplication;
//Executes the scanner statement.
import java.util.Scanner;
//Executes the public class statement.
public class StoreApplication {
// Executes the main method with no parameters.
public static void main(String[] args) {
// Executes & displays the welcome text which consists of what we sell and what promotions we are currently holding.
System.out.printf( "%s\n%s\n%s\n%s\n\n","----------Welcome to Michael's Natural Spring Water----------", "We buy natural spring water directly from Maine and stright \ninto the hands of the customer.", "PROMOTION: 10% off your purchase of more than 100 pounds of \nMichael's Natural Spring Water", "Note: We sell our natural spring water to your weight \nspecifications");
//Executes the scanner input statement.
Scanner input = new Scanner( System.in );
// Prepares all doubles so that a number can be assigned to each double during the mathematics portion.
double PriceBeforeTaxes;
int QuantityOfItem;
int ItemWeight;
double PricePerPound;
double TotalPriceWithTaxes;
double TaxRate;
//Exectues & displays a request for the quantity of item the user would like to purchase.
System.out.printf("Total quantity of item you'd like to purchase? X ");
QuantityOfItem = input.nextInt();
//Executes & displays a request for the quantity in weight the user would like to purchase.
System.out.printf("How much would you like the packages to weight? LBS ");
ItemWeight = input.nextInt();
//Executes & displays a request for the price per a pound the user would like to pay.
System.out.printf("Price per pound of item? $/LBS ");
PricePerPound = input.nextDouble();
//Executes the if statement if and only if the ItemWeight is less than or equal to 100.
if(ItemWeight*QuantityOfItem <= 100){
//Executes & displays the users total before taxes are calculated.
PriceBeforeTaxes = QuantityOfItem*ItemWeight*PricePerPound;
System.out.printf("Your total before taxes comes out to... = $%.2f\n\n", PriceBeforeTaxes);
//Executes & displays the request for the users local tax rate & calculates it into the final cost.
System.out.printf("What is your local tax rate? = ");
TaxRate = input.nextDouble();
TotalPriceWithTaxes = PriceBeforeTaxes*(1+TaxRate);
System.out.printf("\nYour total with taxes comes out to... SUB TOTAL = $%.2f\n\n", TotalPriceWithTaxes);}
//Executes the if statement if and only if the ItemWeight is greater than or equal to 101.
if(ItemWeight*QuantityOfItem >= 101){
//Executes & displays the users total before taxes are calculated with a 10% discount.
PriceBeforeTaxes = (QuantityOfItem*ItemWeight*PricePerPound)/10;
System.out.printf("Your total with a 10%% discount before taxes comes out to... = $%.2f\n\n", PriceBeforeTaxes);
//Executes & displays the request for the users local tax rate & calculates it into the final cost with a 10% discount.
System.out.printf("What is your local tax rate? = ");
TaxRate = input.nextDouble();
TotalPriceWithTaxes = PriceBeforeTaxes*(1+TaxRate);
System.out.printf("\nYour total with a 10%% discount after taxes comes out to... SUB TOTAL = $%.2f\n\n", TotalPriceWithTaxes);}
}
}