Friday, May 27, 2022

Computer Science Basics: Sequences, Selections, and Loops

Behind all of the software that we use on a daily basis there's a code being run with all sorts of different terms and symbols surprisingly it can often be broken down into three simple programming structures called sequences selections and loops these come together to form the most basic instructions and algorithms for all sorts of software a .

Sequence is a series of actions that are completed in a specific order action 1 is performed then action 2 then 3 etc until all of the actions in the sequence have been carried out a sequence we do every day is a morning routine you might wake up drink some water take a shower beat breakfast and so on everyone's routine is different but they're all .

Made up of a sequence of various actions selections are a bit different instead of following a specific order of events they ask a question in order to figure out which path to take next let's say you go to brush your teeth and you find that you're out of toothpaste you then ask do I have any more toothpaste if the answer is no then you would add it to .

Your shopping list but if the answer is yes then you would just use the toothpaste this is really all a selection is doing answering a question based on what it finds the third programming structure is a loop like selections loops also ask questions however the difference is they ask the same question over and over and over .

Again until a certain task is complete for example take the act of hammering a nail even though you may not realize it you're constantly asking yourself is the nail all the way in when the answer is no you hammer the nail again you continue to repeat this question until the answer is yes and then you stop loop's allow programmers to efficiently .

Code repetitive tasks instead of having to write the same actions over and over again these three programming structures may seem fairly simple on their own but when combined they can create some pretty complex software GCF global creating opportunities for a better life

RELATED ARTICLES

Most Popular