Price calculation:
Create a customer basket that allows a customer to add products and provides a total cost of the basket including applicable discounts.
Available products
Product | Cost |
---|---|
Butter | £0.80 |
Milk | £1.15 |
Bread | £1.00 |
Offers |
- Buy 2 Butter and get a Bread at 50% off
- Buy 3 Milk and get the 4th milk for free
Scénarios
- Given the basket has 1 bread, 1 butter and 1 milk when I total the basket then the total should be £2.95
- Given the basket has 2 butter and 2 bread when I total the basket then the total should be £3.10
- Given the basket has 4 milk when I total the basket then the total should be £3.45
- Given the basket has 2 butter, 1 bread and 8 milk when I total the basket then the total should be £9.00
Design required
Requirements :
1 - Build reusable components
2 - Build the app based on a functional component.
3 - Frameworks to use: react native / Flutter
4- Try to optimize rendering time as much as possible.
$ yarn install
$ yarn start
Then follow instructions in the new tab in your web-browser.