Friday, December 23, 2016

Project 1: Calculator

  This project was developing a fully functional JavaScript calculator. At first it was hard because I thought it was more complicated than it actually was. At first I thought it took arrays and loops when I didn’t have to use them. I looked up a tutorial and it really educated me. It recommended using the form tag that I never used before. The rest of the code was making buttons and the display section of the calculator. The inputs appeared in the display because of functions that already existed. There was no need to define my own functions. The main code I used was “<input type=button value="#" OnClick="calculator.view.value+='#'">”  to show the numbers and the operators. The location to display the numbers and the operators is in the calculator form in the view colspan. This is why it is shown in the code. For the “clear” button, there was an apostrophe instead of a number. For the “=” button the end was changed to “calculator.view.value=eval(calculator.view.value)”  This project really showed me what I can do with coding.

No comments:

Post a Comment