Notes For Basic Programming
Notes For Basic Programming
3. Arithmetic and Logic Unit (A.L.U) – the most Flowchart – a modeling tool used to illustrate data,
significant component inside the CPU. It is the instructions, process, information and workflow by the
chief of operations of the computer. use of specialized symbols. It is a step-by-step
Two major operations of Arithmetic and Logic graphical representation of a solution.
Unit:
a. Mathematical operations (addition,
subtraction, multiplication and division)
b. Logical operations (comparisons of data
such as; greater than, less than, greater
than or equal to, and less than or equal to)
Exercise: Suppose we have variables A and B and When the computer executes input
the values of A and B are 5 and 10, respectively. transaction, it expects data to be entered through the
What will happen if we have an instruction of A=B? keyboard. If none is typed in, the computer simply
waits for an input data, if no data was entered, the
Working with process symbols computer just wait for the user and gives no
response. To prevent this scenario, programmers
Basic things to remember in flowcharting: must develop the program in a way that it can
communicate to the user. For the program to
1. A flowchart always start communicate, it must have a descriptive statement to
with the instruction ask the user what to do and what type of data to
START/BEGIN … the only input.
start In the same manner, the output should also
guideline to remember in the
terminal symbol is the include a descriptive statement to communicate to
consistency of terminologies. the user the processed data to add meaning and
The organized way of writing value to it, and making it a “useful information”.
the instruction is to use pairs. Output instruction defines when and where to release
START–STOP or BEGIN-END the data in the program.
Print 4 6 10
(C)
A B C
Print(C,B,A) 6 4 2 10
A B C
Exercises:
1. Create a flowchart that will accept two
2, 4, 6 integers and print the sum
Process
Process symbol is the only area in the
program where all arithmetic computations take
place. Aside from the mathematical computation, it
can also perform an assignment. This occurs when a
variable needs to accept new data to meet the
required solution.