BASIC PzdbzcbvROGRAMMING PRINCIPLES
BASIC PzdbzcbvROGRAMMING PRINCIPLES
3. Open/Closed
a. Make your code open to extension but closed to modification.
5. Single Responsibility
a. Every class or module in a program should only provide one specific
functionality.
6. Separation of concern
a. is an abstract version of the single responsibility principle. This idea states that a
program should be designed with different containers, and these containers
should not have access to each other.
2. Logic formulation (single step / resolution to the problem) - the process of coming out w/
the basic steps to implet a procedure in programming. This is usually resorted to when
having top-down design. Flowcharts and pseudo-codes are the two of most common
output of the exercise.
a. Logic - is a grammar of correct thinking and reasoning.
3. Coding (conversion) -
2 TYPES OF FLOWCHART
1. System flowchart
a. display how data flows in a system and how decisions are made controls events.
b. Show the flow of data to and through the major components of a system such as
data entry, programs, storage media, processors, and communication networks.
2. Program Flowchart
a. A graphical representation of the sequence of operations in a program.
b. It shows the sequence of instructions in a single program or subroutine.
PROGRAMMING SYMBOLS
STOP, START OR
RETUNR
= / ( OPEN CLOSE -
+)
4. DECISION - indicates logical comparison between two values. Evaluating wether the is
equal greater, or less than the second value.
=
>
NO / <
YES /
else /
TRUE
False Example x
>5
x=y
5. PREPARATION - used to define twi or more variable. Should appear only once for every
flowchart.
6. PRE DEFINE PROCESS - indicate another block of programming code giving another
programming steps.
Ex. call name of a flow chart
followed by “RETURN”. FYI. one
time call after return
Ex. TAX
START
Use to
continue flow
chart within
the page
9. FLOWLINE - indicate the flow of programming steps. fyi : used straight line nt curve line
when making a flow chart.
VARIABLE - is a special register that can assume a value. (a, b,c, d, etc).
1. Linear structure (linear sequence ex. Straight flow chart) - nothing more than the
sequential execution of programming steps.
2. Conditional / Relational / Selection Structure (result to an evaluation or w/
decision box) - refers to the branching of control depending on the result of the
evaluation.
3. Loop Structure (reiterate condition or repetitive) - refers to repetitive execution of
steps until a certain condition occurs.
DECISION STRUCTURE
VARIABLE
COUNTER / CTR - is a variable that can accept integer value. it may be incremented or
decremented with a value of 1. (fyi: meaning wlang meaning ung value, either plus 1 or minus.)
ex. Fvotectr, mvctr, ctr
PROBLEM#8
● Draw a flowchart to accept a value 7 times. Print all the value accepted.
PROBLEM # 9 (LOOP)
• Draw a flowchart to Accept a value 7 times.
• Print all the value accepted if the value accepted ranges from 5 to 10 or 20 to 30.
• Count the total no. of values printed and not printed and at the end of processing print it out.
PRTCTR, NPRTCTR.
PROBLEM # 10 (LOOP)
• Draw a flowchart to Accept a value
UNTIL the value is equal to 777.
• Print all the value accepted if the value accepted ranges from 5 to 10 or 20 to 30 or 40 to 55.
• Count the total no. of values printed and not printed and at the end of processing print it out.
PRTCTR, NPRTCTR.
SWITCH / SW - is a register from which a choice can be made. The value that it may
contain usually are “On or Off”. “On” can be represented with value of 1, and “Off” with a
value of 0.
SW - switch
RCTR - record counter
EOFSW - end of file switch
ESW - end switch
FLAGSW -
PROBLEM # 11 (SWITCH)
● Draw a flowchart to accept a value until the accepted value is 777.
● Of the value accepted do the following
Print the first value, skip the next… repeat the process.
PROBLEM # 12 (SWITCH)
ACCUMULATOR - is a register that can hold bigger values with or without decimal
places. FYI: refers to any variable but doesn’t include SW or CTR.
PROBLEM # 13 (ACCUMULATOR)