Exercise 10 · Chapter: ArraysOptional+50 XP
Shopping Cart
Build a simple shopping cart! Read the number of items, then for each item read its name and price.
Print each item with its price in the format name: $price, then print the total.
Example input:
2 apple 1 banana 2
Example output:
apple: $1 banana: $2 Total: $3
Need a hint?
3 available · costs 5 XP each
javascript
Output
Run your code to see the output here.