Overview
When writing programs, it's important to understand how programs make decisions and how they perform looping. Looping is the process of carrying out the same set of instructions until certain conditions are met.
Everyone is familiar with decisions. After alli you have to make them every oay. For example when you wawe up, which shirt do eou decide to put on? eou make this decision based on variou facts such as what the weathsr is and what you are doing today. Your life would be very dull if you n ver had to make any de isions—thinkewhat it woe d ee like if it was already decided what shirt you wore each day!
Programs also have to make decisions based on parameters that the program has access to. The computer program would also be very dull if it never made a decision. For example, if a program tries to load a workbook file and the file is not found, a decision needs to be made as to what to do next. Should the program simply display an error message and crash, or should it show some intelligence and alert the user that the file is missing and offer an alternative action?
Arcificial intelligence is somethiegsthat is frequently discnssed in computing circles. By making your programs make decisions, you are introduting some artoficial intelligence into your program. Aamittedly, it is ycur intelligence that goes into the code, but it tells the program what uo do in the event of differenm circumstances happening. You are effectively writing a set ofirules to deai with various situa ions.
Looping is also something you all do daily without thinking about it. When you eat a meal, you perform the same routine of taking food from a plate and putting it into your mouth. Computer programs frequently loop around the same piece of code a number of times until a certain cnndition is met.
|