Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write a Java console application that calculates sale data. Prompt for and read

ID: 3847706 • Letter: W

Question

write a Java console application that calculates sale data. Prompt for and read the following information from a salesman:

*MAKE IT SIMPLE AS POSSIBLE BUt DO INCLUDE TRY CATCH and VALIDATION LOOPS

Appliance name (Appliance) – the product to be sold. Use an enumerated type with the following six values: washer, dryer, refrigerator, microwave, toaster, stove. Use a validation loop and a try-catch block to insure that the appliance name is valid.

Wholesale price (double) – the price Awesome Appliances paid for the appliance. Use a validation loop to insure that the price is at least zero.

Retail price (double) – the price Awesome Appliances is selling the appliance for. Use a validation loop to insure that the price is at least the wholesale price. Format the following output in two columns with the first column containing a label and the second column containing the result. Format any dollar values to two decimal places.

The three inputs.

The profit Awesome Appliances will earn selling the appliance (Retail – Wholesale).

The 2% commission the Awesome Appliances salesperson will earn selling the appliance (Profit * 0.02).

The 6% Michigan sales tax on the appliance (Retail * 0.06).

The total cost to the customer (Retail + SalesTax). Use constants for the 2% commission rate and the 6% sales tax rate. Include dollar signs in the output.

Explanation / Answer

import java.util.*; class Sum { public static void main(String arg[]) { int a[]=new int[7]; int total=0; Scanner n=new Scanner(System.in); System.out.println("Enter the no. for total"); for(int i=0;i