Home / Expert Answers / Computer Science / nbsp-note-i-want-this-system-in-java-and-you-should-use-switch-statement-if-statement-and-while-s-pa243

(Solved):  Note:I want this system in java and you should use switch statement , if statement and while s ...



 Note:I want this system in java and you should use switch statement , if statement and while statement to do the program

The Grocery Store System

The Grocery store makes a seasonal special offer on selected items. They decided to make an application for the grocery that displays their offers from time to time and lets the users make benefit from it. Your job is to develop a basic java application to help them display their offer, let the users select items, and print out the bill including the VAT.

Please read the description below to understand what is required

A. Display the Grocery Store Today’s Offer: When your application starts, it should display a welcoming message followed by the special offers for today:

 

B. Input validation After displaying the items in the current offer, the application will ask the user repeatedly to enter his/her choice until the user enters 3 to exit the loop. Each time the user can choose one of the three options (1,2, or 3):

1. If the user selects a number other than (1 , 2, or 3), the program will print a wrong selection message ("Wrong Selection of a product!"). Then, it will display the menu again to let the user to select a new selection.

2. Choice 1: If the user selects 1 to buy “Tide 2.5kg”, the program will ask the user to enter the quantities. Noted that zero value is not allowed (“Wrong value!!!”). Also, you should check that the entered value does not exceed the limit (5) as described in the message before computing the price. price= quantity * 20;

3. Choice 2: If the user selects 2 to buy “Milk 1.5L”, the program will ask the user to enter the quantities. Noted that zero value is not allowed (“Wrong value!!!”). Then compute the price as: price= quantity * 5;

4. Choice 3: Exit the menu.

C. Read the Customer Information:

After the user finishes his/her order, the program will ask him/her to enter the following information: Full name (String): enter the First name and last name in the same line separated by a space.

Phone number (String): the program must check the validity of the phone number. It should start with 0 and be 10 characters long.

 

D. Computing the total cost including VAT:

Finally, Add VAT to the price and print out to the console the total cost including VAT (Note that VAT is a constant which is 15 % of the price)

 

The output:

Appendix (Output Example)
Your programs output must be EXACTLY the same as the following output:

 

Please enter your choice: 3
To keep you in touch with our promotions please enter the following information:
Full name: Moham

 

Please enter your chaice: 3
To keep you in touch with our promotions please enter the following information:
Full name: Moham???????

Appendix (Output Example) Your program's output must be EXACTLY the same as the following output: Please enter your choice: 3 To keep you in touch with our promotions please enter the following information: Full name: Mohammed Ahmed Phone number \( (05 \) oocooocox \( ): 0665544345 \) Please enter your chaice: 3 To keep you in touch with our promotions please enter the following information: Full name: Mohammed Ahmed Phone number \( [050000000 x) \) : 0665544345 Sorry the entered number is not valid 2022 Grocery Store* Dear Customer: Mohammed Ahmed, Thank you for using this Application ** TAX \( =15 \mathrm{x} \) Tatal Cast including TAX= \( 126.5 \) S.R BUILD SUCCESSFUL (tatal time: 1 minute 14 seconds)


We have an Answer from Expert

View Expert Answer

Expert Answer


The program with comments for better understanding is given below The program with comments for better understanding is given //importing necessary li
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe