Using Java, write a program that calculates the price of a basket of shopping.
The solution should be accomplished in roughly two hours.
Items are presented one at a time, in a list, identified by name - for example "Apple" or "Banana".
Multiple items are present multiple times in the list, so for example ["Apple", "Apple", "Banana"] is a basket with two apples and one banana.
Items are priced as follows:
- Apples are 35p each
- Bananas are 20p each
- Melons are 50p each, but are available as ‘buy one get one free’
- Limes are 15p each, but are available in a ‘three for the price of two’ offer
Given a list of shopping, calculate the total cost of those items.
- Shopping page consisting of two sections
- Item list - list of available shopping items with cost per item
- Cart - displays items added in cart
Screen.Recording.2024-03-31.at.2.35.48.PM.mov
- if no item added it displays empty cart message
- if items are added it will merge them into one item and update quantity
- displays total cost of each item as per the offer applicable
- displays the total cart cost
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.