Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer using a screenshot/image instead of pasted text. Thank you! Please answer using a screenshot/image instead of pasted text. Thank you! Write a Java

Please answer using a screenshot/image instead of pasted text. Thank you!

image text in transcribedimage text in transcribed

Please answer using a screenshot/image instead of pasted text. Thank you!

Write a Java program to perform the grocery check-out procedure for a simple store with exactly 5 products: Product Price per pound $0.44 $0.99 Bananas Apples Cucumbers $ 1.19 Carrots Oranges $0.89 $0.79 Prompt and get the weight for each product, then compute the total bill. Now, determine the possible discounts for the purchase. Customers can get 2 types of discounts: . 10% discount for customers with loyalty cards 10% discount for customers who purchased for $100 or more. This discount increases to 15% if the customer purchased for $200 or more Both types of discounts can be combined. Our program should give maximum possible discount to each customer. Save your program as Store.java and upload it to complete the assignment You can assume that all the user inputs are valid & the user will enter 0 for products (s)he does not purchase - no need to do any input validation explicitly. Here are a few sample inputs & outputs (but your program should work for all valid inputs. TA will test with other values) Sample run #1A : Enter the weight for Bananas: 10 Enter the weight for Apples: 11 Enter the weight for Cucumbers 9 Enter the weight for Carrots: 10.5 Enter the weight for Oranges: 10 Your total is $43.25 Do you have loyalty card (y)? n Have a nice day! Sample run #18: Enter the weight for Bananas: 10 Enter the weight for Apples: 11 Enter the weight for Cucumbers 9 Enter the weight for Carrots: 10.5 Enter the weight for Oranges: 10 Your total is $43.25 Do you have loyalty card (y)? y You got 10% discount $4.32 Your discounted total is $38.92 Have a nice day

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Technology

Authors: Suad Alagic

1st Edition

354096276X, 978-3540962762

More Books

Students also viewed these Databases questions

Question

LO5 Illustrate the steps in developing a base pay system.

Answered: 1 week ago

Question

LO3 Outline strategic compensation decisions.

Answered: 1 week ago