M2S1 Part 1 Flashcards
STEP-BY-STEP METHOD OF
SOLVING A PROBLEM
ALGORITHM
procedure or formula
for solving a problem, based on
conducting a sequence of specified
actions
ALGORITHM
Algorithm can be expressed using :
pseudocode or flowchart.
will transform the problem’s input into
its output.
ALGORITHM
will describe an action that
the computer needs to take
Each instruction in the algorithm
Write the algorithm in the Processing column of the what
InputProcess-Output (IPO) chart.
Algorithm process:
- enter the input items
2.1. process the input items
2.2. calculations using the input items. - display, print, or store
the output items.
refer to the computer screen, printer,
and a file on a disk, respectively
Display, print, and store
FALSE CODE
PSEUDOCODE
has no syntax like
any of the programming language and thus can’t be compiled
or interpreted by the computer
PSEUDOCODE
an implementation of an algorithm in the form of
annotations and informative text written in plain English.
PSEUDOCODE
not standardized.
PSEUDOCODE
used to indicate common inputoutput and processing operations. They are written fully in
uppercase.
keywords
When writing pseudocode, we assume that the order of execution
of the statements is from ______
top to bottom
This is the start of your pseudocode
START
This is data retrieved from the
user through typing or through an input device
INPUT, ENTER, READ / GET :
This will show your output to
a screen or the relevant output device
PRINT, OUTPUT, DISPLAY, SHOW:
This is used to calculate
the result of an expression.
COMPUTE, CALCULATE, DETERMINE:
To initialize values
SET, INIT:
To increase the value of a variable
INCREMENT, BUMP:
To reduce the value of a variable
DECREMENT:
common operators:
assignment, comparison, arithmetic, and logical
← or :=
Assignment
=, ≠, , ≤, ≥
Comparison (Relational):
+, −, ×, /, mod
Arithmetic
and, or
Logical
During algorithm development, we need statements which evaluate expressions and execute instructions depending on whether the expression evaluated to True or False.
conditional
to repeat a set of instructions in order to generate a
sequence of outcomes.
ITERATION/LOOPING: