Javascript calculating tool prices for hardware store (School lab assignment)