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

Hey, i need major help with my project... if some1 can help me runthe project i

ID: 3617352 • Letter: H

Question

Hey, i need major help with my project... if some1 can help me runthe project i will try to give you 30pnts by submitting couplebasic question for u to answer after you help me complete thisjava....
Here are the instructions...
I need my java to run like this...thankyou
job is to fool-proof that program so if the customer doesnot follow the ascribed order then there should be guidance onwhat to do first. Here is a sample of this behavior: This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:2 Shop is not setup yet! This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:4 Shop is not setup yet! This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want: The program will keep asking the 4 main questions until theuser decides to setup Shop. Here is a sample run with one misstepby the customer: This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:1 Please enter the number of items: 2 Enter name of product 0 :Shampoo Enter price of product 0 :13.13 Enter name of product 1 :Conditioner Enter price of product 1 :10.99 Please enter the amount to qualify for discount: 100 Please enter the discount rate(0.1 for 10%): .05 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:3 Try again: You have not bought anything This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:2 Enter the amount of Shampoo : 10 Enter the amount of Conditioner : 20 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:3 10 count of Shampoo @ 13.13 = $131.3 20 count of Conditioner @ 10.99 = $219.8 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:4 Thanks for coming! Sub Total: $351.1 -Discount: $17.555000000000003 Total : $333.545 Sample of purchasing multiple times with differentamounts: This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:1 Please enter the number of items: 3 Enter name of product 0 :Shampoo Enter price of product 0 :10.99 Enter name of product 1 :Conditioner Enter price of product 1 :6.99 Enter name of product 2 :Combo Enter price of product 2 :12.99 Please enter the amount to qualify for discount: 50 Please enter the discount rate(0.1 for 10%): .1 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:2 Enter the amount of Shampoo : 1 Enter the amount of Conditioner : 1 Enter the amount of Combo : 1 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:3 1 count of Shampoo @ 10.99 = $10.99 1 count of Conditioner @ 6.99 = $6.99 1 count of Combo @ 12.99 = $12.99 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:2 Enter the amount of Shampoo : 0 Enter the amount of Conditioner : 1 Enter the amount of Combo : 0 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:3 1 count of Conditioner @ 6.99 = $6.99 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:2 Enter the amount of Shampoo : 1 Enter the amount of Conditioner : 0 Enter the amount of Combo : 1 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:3 1 count of Shampoo @ 10.99 = $10.99 1 count of Combo @ 12.99 = $12.99 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:4 Thanks for coming! Sub Total: $23.98 -Discount: $0.0 Total : $23.98 The user might enter inputs other than 1-4 so must catch itlike this: This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:5 Error: Do not know 5 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:
Here are the instructions...
I need my java to run like this...thankyou
job is to fool-proof that program so if the customer doesnot follow the ascribed order then there should be guidance onwhat to do first. Here is a sample of this behavior: This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:2 Shop is not setup yet! This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:4 Shop is not setup yet! This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want: The program will keep asking the 4 main questions until theuser decides to setup Shop. Here is a sample run with one misstepby the customer: This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:1 Please enter the number of items: 2 Enter name of product 0 :Shampoo Enter price of product 0 :13.13 Enter name of product 1 :Conditioner Enter price of product 1 :10.99 Please enter the amount to qualify for discount: 100 Please enter the discount rate(0.1 for 10%): .05 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:3 Try again: You have not bought anything This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:2 Enter the amount of Shampoo : 10 Enter the amount of Conditioner : 20 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:3 10 count of Shampoo @ 13.13 = $131.3 20 count of Conditioner @ 10.99 = $219.8 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:4 Thanks for coming! Sub Total: $351.1 -Discount: $17.555000000000003 Total : $333.545 Sample of purchasing multiple times with differentamounts: This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:1 Please enter the number of items: 3 Enter name of product 0 :Shampoo Enter price of product 0 :10.99 Enter name of product 1 :Conditioner Enter price of product 1 :6.99 Enter name of product 2 :Combo Enter price of product 2 :12.99 Please enter the amount to qualify for discount: 50 Please enter the discount rate(0.1 for 10%): .1 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:2 Enter the amount of Shampoo : 1 Enter the amount of Conditioner : 1 Enter the amount of Combo : 1 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:3 1 count of Shampoo @ 10.99 = $10.99 1 count of Conditioner @ 6.99 = $6.99 1 count of Combo @ 12.99 = $12.99 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:2 Enter the amount of Shampoo : 0 Enter the amount of Conditioner : 1 Enter the amount of Combo : 0 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:3 1 count of Conditioner @ 6.99 = $6.99 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:2 Enter the amount of Shampoo : 1 Enter the amount of Conditioner : 0 Enter the amount of Combo : 1 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:3 1 count of Shampoo @ 10.99 = $10.99 1 count of Combo @ 12.99 = $12.99 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:4 Thanks for coming! Sub Total: $23.98 -Discount: $0.0 Total : $23.98 The user might enter inputs other than 1-4 so must catch itlike this: This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:5 Error: Do not know 5 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want: job is to fool-proof that program so if the customer doesnot follow the ascribed order then there should be guidance onwhat to do first. Here is a sample of this behavior: This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:2 Shop is not setup yet! This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:4 Shop is not setup yet! This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want: The program will keep asking the 4 main questions until theuser decides to setup Shop. Here is a sample run with one misstepby the customer: This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:1 Please enter the number of items: 2 Enter name of product 0 :Shampoo Enter price of product 0 :13.13 Enter name of product 1 :Conditioner Enter price of product 1 :10.99 Please enter the amount to qualify for discount: 100 Please enter the discount rate(0.1 for 10%): .05 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:3 Try again: You have not bought anything This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:2 Enter the amount of Shampoo : 10 Enter the amount of Conditioner : 20 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:3 10 count of Shampoo @ 13.13 = $131.3 20 count of Conditioner @ 10.99 = $219.8 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:4 Thanks for coming! Sub Total: $351.1 -Discount: $17.555000000000003 Total : $333.545 Sample of purchasing multiple times with differentamounts: This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:1 Please enter the number of items: 3 Enter name of product 0 :Shampoo Enter price of product 0 :10.99 Enter name of product 1 :Conditioner Enter price of product 1 :6.99 Enter name of product 2 :Combo Enter price of product 2 :12.99 Please enter the amount to qualify for discount: 50 Please enter the discount rate(0.1 for 10%): .1 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:2 Enter the amount of Shampoo : 1 Enter the amount of Conditioner : 1 Enter the amount of Combo : 1 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:3 1 count of Shampoo @ 10.99 = $10.99 1 count of Conditioner @ 6.99 = $6.99 1 count of Combo @ 12.99 = $12.99 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:2 Enter the amount of Shampoo : 0 Enter the amount of Conditioner : 1 Enter the amount of Combo : 0 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:3 1 count of Conditioner @ 6.99 = $6.99 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:2 Enter the amount of Shampoo : 1 Enter the amount of Conditioner : 0 Enter the amount of Combo : 1 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:3 1 count of Shampoo @ 10.99 = $10.99 1 count of Combo @ 12.99 = $12.99 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:4 Thanks for coming! Sub Total: $23.98 -Discount: $0.0 Total : $23.98 The user might enter inputs other than 1-4 so must catch itlike this: This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:5 Error: Do not know 5 This program supports 4 functions: 1. Setup Shop 2. Buy 3. List Items 4. Checkout Please choose the function you want:

Explanation / Answer

please rate - thanks import java.util.*; public class store {static int items=0; static boolean bought=false; static String[] name=new String[50]; static double[] price=new double[50]; static double qualify=0; static double rate=0; static int [] cart=new int [50]; static Scanner in=new Scanner(System.in); public static void main(String[] args) {int choice=0; boolean setupDone=false; while(true)     {choice=menu();        if(!setupDone&&choice!=1)                 System.out.println("Shop is notsetup yet!");        else            {switch(choice)                 {case 1: setup();                         setupDone=true;                             break;                   case 2: buy();                           break;                   case 3: list();                           break;                   case 4:                           checkout();                             System.exit(0);                   }             }       }                                       } public static void setup() {int i,n; System.out.print("Please enter the number of items: "); n=in.nextInt(); items+=n; for(i=0;i