Lessons On the Illegal Actions

Coding is the future. Students are learning coding in every school with many different lessons and figuring out patterns of what is going around. They figure out how to move things around in videos or form their own virtual lives.

Coding brings depth, not only to a screen, but also to real life transactions, making them much easier to understand.

Roger Mayo, Computer Science teacher, mentioned that his class has recently been working on learning how to make code repeat.

“There’s something called recursion, that we learned how to use. Then we found out about loops that makes looping a lot easier,” Mayo said.

He has, then after, introduced his students to files and has them “…reading stuff from a file and doing stuff to it.”

To make a lesson for his students in this form of coding, he had them do three simple parts.

The first one is simply a bank account. The students protect it from being hacked and cannot deposit a negative number or withdraw more money than they already have in the account. They are taking a code that they were given and adding conditions to it to make sure nothing illegal happens.

With the bank account portion of this lesson, they found they were able to have a starting value and deposit and withdraw money.

There is a system statement which these students are using called a ‘try’ and a ‘catch.’ The ‘try’ is king of like, a default statement. With ‘try,’ the students write out what they want the code to test out first. They enter an initial value for the bank account and check to see if something illegal happens.

“If you enter in a negative value for the initial notes, then it’s gonna take that ‘try’ statement and move over to the ‘catch’,” Jordan King explained.

They are always checking to see if an illegal argument exception is coming in.

“You can’t deposit negative numbers,” King continued.

The second part is called average, which entails file organization. There is a file the students must read. They have no idea how many numbers there are in the file and are given a bunch of random numbers. The program goes through each line and determines how many lines there are. Each line has one number. The students read all the numbers and connect the average of all of them, then put it back into the file.

The last part is called compression. The students take a file and a file writer. They read all of the spaces within a file at the beginning of the file and get rid of them through compressing. They also count how many spaces there were and how many spaces there would have been. The numbers then line up on the side of the screen and students are able to redeem the big file and write back a smaller file.

This part of the lesson is how the students make files and do errors.

“It takes code that we’ve been learning and applies it to more realistic conditions… You actually take that code, analyze files, analyze websites, and check for illegal conditions,” junior Tristan Walley explained.

Mayo’s class is preparing students for the future, giving them a glimpse into the cheat codes of the digital age.