4 homeworks totaling 1200-1400 words minimum
Read and respond 150 words minimum.
The three basic structures in programming are selection, sequence, and loops. The selection structure asks a question, and, depending on that answer it takes one of two courses of action. In programming code, the selection structure is called an if-then statement. It is used so that a program checks if a value is true or false. If a value is true, one course of action is taken. If the value is false, another course of action is taken. My example of selection structure is boiling water. Fill a pot with water and place it over high heat on a stove. The value would be boiling water. A true value would mean that the water is boiling and the task is complete. A false value would mean the water has not reached its boiling point and the pot of water must remain over the high heat on the stove.
The sequence structure is defined as performing an action or task and then performing the next action in order. In a program the sequence ends once a process finished. In a module you return to the beginning of the program. An example of sequence structure is boiling an egg. You put the egg in a pot, fill the pot with water, place the pot over high heat on a stove, and leave the egg in boiling water for ten minutes.
A loop is when a program continues to repeat actions while a condition remains true. It’s basically repeating the same steps over and over. An example of a loop is when I’m typing in Microsoft Word. If I press the letter k on my keyboard it will be displayed over and over on my word document, page after page, until I stop pressing the key.
Read and respond 150 words minimum.
Sequence structure is used to move a program from point A to point B. It's a list of movements that can't skip a step, otherwise the program won't make sense. For instance, when giving the instructions on how to put an car engine together, if one of the piston covers aren't in the right place or if there isn't any motor oil in the well, it either won't run or it won't run properly. Same with computer programming, if you don't write the correct sequences of commands to a computer program, the program either will run poorly or won't run at all.
A selection is just that in computer programming. A selection is broken up into two ideas. Depending on what's written, the outcome can have a true or false determination. It also depends on what criteria of information you're working with. So in the same example of the car engine, if the car engine is a Nissan Altima there's going to be a different process of putting the engine together then it would be if it was a Ford Explorer or a Dodge Dakota. The selection changes depending on the conditions.
A loop is a recurring set of commands within a program that repeats itself. This is valuable programming tool if a repetitive task needs to be performed but the time or manpower to perform the task may not be available. For instance, a machine that cuts checks for company payroll is an example of a program that's written in a loop.