Fourth graders at Trevvett have been learning about decimals up to thousandths. They have learned how to compare decimals and round them (SOL4.3). Today, students in Ms. Cockrum’s class created their own decimals calculators with Google sheets. First, I asked if they knew of a calculator that could add or subtract decimals. They all did. Then I asked if they knew of a calculator that could compare or round decimals. None of them did, so they were very surprised when I explained that they would create a calculator that could do that. I pointed out that they would be coders today, and I wanted them to go through the same process that coders go through when creating a new program or app. Coders often start out with a flowchart to make sure that each step of the code is in the correct order. We discussed the steps a calculator would need to go through to compare two decimals. It would have to decide if one of the numbers was equal to (=), greater than (>) or less than (<) the other. Then it would have to display the correct symbol. A decision on a flowchart is usually a diamond shape, and the answer is either "yes" or "no." So our first decision could be, "Is A greater than B?" If the answer is "yes," the code would display a ">” symbol. If the answer was “no,” the code would continue to the next decision. The next decision might be, “Is A less than B?” and so on. The decisions could be in any order, but the final step isn’t really a decision, it would be a command to display the only symbol that was left. The shape for output in a flowchart is usually a parallelogram, but I told them they could use whatever shape they wanted. We used Google draw to make the flowcharts, then we opened this template in Google sheets to create the code. I instructed the students to type any decimal they wanted in the decimals columns. Then we wrote code, or formulas, in the other columns. Rounding is the easiest, so we started with that. I showed them the code for rounding to the ones place, then I let them figure out the code for rounding to the other places. The code for rounding a number in cell E2 is: ones place =ROUND(E2,0); tenths place =ROUND(E2,1); hundredths place =ROUND(E2,2). Next, we used our flowcharts to write the code for comparing decimals. If decimals are in cells A2 and C2, the code to display the symbol would go between them in cell B2. It may look something like this (but it could be in a different order):
=IF(A2 > C2,”>”, IF(A2 < C2,"<","="))
The students were excited to see their calculators working, and if they didn’t work, the students had to think critically and problem-solve to figure out the reasons. That’s actually one of the most valuable lessons of learning how to code. Our final step was to share the links to our spreadsheets on Schoology. You can see some samples from Ms. Cockrum’s class and Ms. Messer’s class (5th grade) here.