Loading repository data…
Loading repository data…
kulkarnishruti4 / repository
This question was given to me as part of an interview - write a simple java program to calculate the price of a basket of shopping list. The items in the basket are calculated as follows - Apples are 35p. Bananas are 20p. Melons are 50p and offer on melons is - buy 1 get 1. Limes are 15p and offer on limes are - buy 3 for price of 2.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
This service scans the shopping basket and generates a bill based on different prices and offers.
This project implements a Strategy Pattern, wherein strategy for calculating the price of an 'Item' in the shopping basket, is decided dynamically. Currently three strategies are created - Fixed Price Strategy, 'Buy One Get One Free Strategy' and 'Buy Three for the Price of Two'. Based on the Strategy and the price of an item, a final price is calculated for each item.
Java 8 or above