Cash Register javascript code for project 1