[go: up one dir, main page]

0% found this document useful (0 votes)
52 views2 pages

Example: c ← 2πr, c:= 2πr: Mathematical operations

Pseudocode uses symbolic code to describe algorithms and programs at a high level before translation to a programming language. It consists of statements executed from top to bottom and uses common mathematical, logical, and programming keywords. Functions allow breaking programs into reusable parts.

Uploaded by

Josh Dumalag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views2 pages

Example: c ← 2πr, c:= 2πr: Mathematical operations

Pseudocode uses symbolic code to describe algorithms and programs at a high level before translation to a programming language. It consists of statements executed from top to bottom and uses common mathematical, logical, and programming keywords. Functions allow breaking programs into reusable parts.

Uploaded by

Josh Dumalag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Pseudocode is an informal high-level description of a computer program or algorithm.

It is written in
symbolic code which must be translated into a programming language before it can be executed.
A statement is defined as an instruction that directs the computer to perform a specific action. In
writing pseudocode, we will refer to singular instructions as statements.
When writing pseudocode, we assume that the order of execution of the statements is from top to
bottom.
Mathematical operations are integral to solution development. They allow us to manipulate the
values we have stored. Here are common mathematical symbols:
Assignment: ← or := Example: c ← 2πr, c := 2πr
Comparison: =, ≠, <, >, ≤, ≥
Arithmetic: +, −, ×, /, mod
Floor/ceiling: ⌊, ⌋, ⌈, ⌉a ← ⌊b⌋ + ⌈c⌉
Logical: and, or
Sums, products: Σ Π Example: h ← Σa∈A 1/a
A keyword is a word that is reserved by a program because the word has a special meaning.
START: This is the start of your pseudocode.
INPUT: This is data retrieved from the user through typing or through an input device.
READ / GET: This is input used when reading data from a data file.
PRINT, DISPLAY, SHOW: This will show your output to a screen or the relevant output device.
COMPUTE, CALCULATE, DETERMINE: This is used to calculate the result of an expression.
SET, INIT: To initialize values
INCREMENT, BUMP: To increase the value of a variable
DECREMENT: To reduce the value of a variable
CONDITION
IF you are happy IF  THEN  ELSE  ENDIF
THEN smile IF  THEN  ELSE IF ELSE IF  ENDIF
ENDIF
Value 3: statement
CASE variable of OTHERS
Value 1: statement Statement
Value 2: statement ENDCASE

ITERATION
FOR every month in a year PRECONDITION: variable X is equal to 1
Compute number of days WHILE Population < Limit
ENDFOR Compute Population as Population +
Births — Deaths
ENDWHILE

Function clear monitor


Pass In: nothing
Direct the operating system to clear the monitor
Pass Out: nothing
Endfunction

You might also like