Blog #5: Conversion Table Reflection

Silver
4 min readNov 17, 2017

--

How my conversion table looked in the end → Link

What the assignment was: This assignment was to make a Fahrenheit to Celsius conversion table. We needed to go from 20 to 120 degrees Fahrenheit in intervals of 5 and convert each one to Celsius. We were given a basic JS function to convert Fahrenheit to Celsius and the function was (F-32) / (9/5). We could do it anyway we wanted to as long as it was a table with two columns that showed Fahrenheit and its equivalent in Celsius next to it.

What I first thought and did: When we first got this assignment, I thought that it shouldn't be that hard, then I did an attempt to do it and failed miserably. I realized at that moment that I already wanted to give up. To be fair though, I was in a bad mood when it was assigned, so that may of contributed to my feeling for the assignment at the time. I started by making a very basic table into HTML, then I tried to link the function from JS to HTML. I linked it, but I didn't really know what to do next. I had the function working when you put a number in as “F” to represent Fahrenheit, but I didn’t have it connected to my graph and it was only for one section for the table. I could of copied and paste it over and over for each section of the table, but that is a very ineffective way that I was not satisfied with.

My for loop that my friend taught me

What I ended up doing: My next move was to turn to a good friend that’s in the same class, but he has way more experience coding than most of us had. He helped me make a very easy solution that involves using something called a “for loop” and showed me how to make a table using JS. The “for loop” is used to repeat something over and over till it reaches a limit that you set. As “I” represented Fahrenheit, I used some logical operators to make it go from 20 to 120 in intervals of 5. I console.log it to run it in the function we were gave. The “for loop” runs it till it reaches up to 120, just like how we set it. I have all the Fahrenheit numbers converted into Celsius, but I don’t have it in a table just yet. I used all the methods my friend taught me to make a table in JS that is in my “for loop” so that it repeats the steps of the table till it reaches the maximum you set. I made rows with “.insertRow()” and columns with “.insertCell()”. The cells are connected to “i” and “temperature(i)” which is Fahrenheit and the function converting it to Celsius. Since it is a “for loop” it will make rows and columns till it reaches a point where no more values go into the sections, which we set as 120 Fahrenheit.

Shout out to my home slice bread slice! → Image Link

My final opinion on the assignment: This assignment was hands down the most challenging assignment we had so far. I legit started working on it the day we got it, but I didn’t finish it till the day before it was due. It was a really challenging and new experience for us. The only reason why I was able to have it done in a effective way was thanks to my amazing friend. He showed me many more ways to use JS and taught me how those many ways can be used to get task done. I know a lot more about JS thanks to my friend and this assignment, so I’m happy that we had to do it, but I’m also still angry with it because of how much time I had to spend working on it. I’m sure a lot of my classmates feel the same way as well. I saw that most of us struggled badly and some did not even get the function working. I could tell that they were having hard times, yet they looked like they were still having a fun time working with others to try and figure it out. This assignment made us work hard and work with others, so I’m overall glad that we had to do this assignment. I’m looking forward to more assignments that involves the use of JS to a new level that will force us to go even further beyond!

PS: I had some time left over, so I added in some designs that made me smile to help me forget all the time I spent working on that assignment.

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

Thanks for taking your time to read my blog :)

If you have more time, check out my other blogs in the links down below.

--

--