Price Calculator is .Net Core Console application. This is created as an exercise to calculate prices for a shopping basket
The goods that can be purchased, together with their normal prices are:
- Beans – 65p per can
- Bread – 80p per loaf
- Milk – £1.30 per bottle
- Apples – £1.00 per bag Current special offers:
- Apples have a 10% discount off their normal price this week
- Buy 2 cans of Bean and get a loaf of bread for half price The program should accept a list of items in the basket and output the subtotal, the special offer discounts and the final price.
Input should be via the command line in the form
PriceCalculator item1 item2 item3 …
- .Net Core 3.1
- Visual Studio 2019 with C# / Visual Studio code (for dev environment)
Copy Binary folder locally and run PriceCalculator.App.exe file.
Clone Repository on local machine and build solution in Visual studio
PriceCalculator Apple Milk Bread
PriceCalculator Apple Milk Bread
Output =>
SubTotal: £3.10
Apple 10% OFF: - 10p
Total Price: £3.00
PriceCalculator Beans Bread Milk Apple beans
Output =>
SubTotal: £4.40
Buy 2 Beans Get Bread 50% OFF: - 40p
Apple 10% OFF: - 10p
Total Price: £3.90
PriceCalculator Bread Milk
Output =>
SubTotal: £2.10
(No offers available)
Total Price: £2.10
PriceCalculator RandomProduct
Output =>
Invalid product name entered