19Kengo Raganit
2 min readNov 17, 2017

Fahrenheit to Celsius

http://www.thecalculatorsite.com/images/articles/fahrenheit-to-celsius/thermometer-readings.jpg

Fahrenheit and Celsius. 2 units of measuring temperature. Recently for my programming class we were tasked with converting measures of Fahrenheit to Celsius and display it on a table. The criteria was straightforward: the table had to have conversions of 20~120 degrees Fahrenheit to Celsius in 5 degree margins. For example, converting 20, 25, 30, 35 Fahrenheit and so on to Celsius degrees. We were expected to use the knowledge we’ve built up so far on HTML, CSS, and JavaScript.

How I approached the project was to simply create individual scripts within the HTML document for each conversion. I did this because I wasn’t sure how to make a function with variables to automatically do all the conversions for me. Therefore, for every row of my table, I would write <script></script> with the equation converting the Fahrenheit value to Celsius. I made an individual script like this for every single row. I put the Fahrenheit value on one side of the table, and the equivalent Celsius value to the right side of the table. This I did using the table row <tr></tr> and table column <th></th> tags. Finally I created a separate CSS file where I specified table border and color. I also used CSS to style the text and the table into the center using margin-left: auto; and margin-right: auto;. After doing all this my conversion table was complete.

In the end my website got the job done. It followed all the criteria: it had a table with two columns, the Fahrenheit was on the left and the Celsius on the right, and it converted 20 to 120 degrees of Fahrenheit to Celsius. Although I’d say my method is inefficient compared to creating a universal conversion function, I’m glad that I was able to complete the task.

Through this project I learned how to do scripts on HTML documents. Additionally, this project was challenging because I had forgotten how to make tables on HTML. However I overcame this by having a classmate show me the tags to use. To figure things out I asked around for advice and thought on my own. For instance when I had trouble creating a conversion function I decided it would be best to approach the task in a more simple manner.

While all my classmates presented, I saw a few who had done it more efficiently. They had a universal conversion function, and furthermore had a function that created rows for their table using loops. I was impressed because I had to manually input my own rows while they had it done automatically. Conclusively, it seems to be that I have a lot more to learn from my classmates. If I were to do this table differently, I would try to imitate the more efficient method.