This is a command line program written using Node.js and TypeScript which applies specific promotional rules to a dummy basket consisting of items provided via user input.
The items the user can select from can be found below:
ID | Name | Price
0001 | Water Bottle | £24.95
0002 | Hoodie | £65.00
0003 | Sticker Set | £3.99
The promotional rules:
- If you spend over £75 then you get a 10% discount
- If you buy two or more water bottles then the price drops to £22.99 each
The steps to run this program:
cd
into the project directoryyarn run:dev
Example usage:
Enter item ids: 0001,0001,0002,0003
£103.47
To optionally transpile the entire app to JS you can run yarn build
.