Docsity

IGCSE Programming section Cheatsheet, Summaries of Computer science

Toggle sidebar
bg1
NOTES IGCSE CS
-DECLARE < Identifier> : < data type>
- CONSTANT<Identifier> โ€“ <value>
ARRAY
-DECLARE <Identifier> : ARRAY [ 1:100] OF <data type>
INDIVIDUALLY
<Identifier>[#] โ€“ <Value>
GROUP
FOR Indexโ€“ 1 TO U
<Value>[Index] โ€“ โ€œโ€
NEXT Index
ARITHMETIC
MOD- Remainder of Division
DIV- Divided number
+ - * / ^
= equal to
< less than
<= less than or equal to
> greater than
>= greater than or equal to
<> not equal to
STRING OPERATIONS
LENGTH("Happy Days") will return 10
LCASE(๊žŒW๊žŒ) will return ๊žŒw๊žŒ
UCASE("Happy") will return "HAPPY"
SUBSTRING("Happy Days", 1, 5) will return "Happy"
Value โ† ROUND (RANDOM() * 6, 0) // returns a whole number
between 0 and 6
//- used in comments
pf2

Partial preview of the text

Download IGCSE Programming section Cheatsheet and more Summaries Computer science in PDF only on Docsity!

NOTES IGCSE CS

-DECLARE < Identifier> : < data type>

  • CONSTANT โ€“ ARRAY -DECLARE : ARRAY [ 1:100] OF

INDIVIDUALLY [#] โ€“

GROUP FOR Indexโ€“ 1 TO U [Index] โ€“ โ€œโ€ NEXT Index

ARITHMETIC MOD- Remainder of Division DIV- Divided number

      • / ^ = equal to < less than <= less than or equal to > greater than >= greater than or equal to <> not equal to STRING OPERATIONS LENGTH("Happy Days") will return 10 LCASE(๊žŒW๊žŒ) will return ๊žŒw๊žŒ UCASE("Happy") will return "HAPPY" SUBSTRING("Happy Days", 1, 5) will return "Happy" Value โ† ROUND (RANDOM() * 6, 0) // returns a whole number between 0 and 6 //- used in comments

UNMEASURABLE PROCEDURE

PROCEDURE

ENDPROCEDURE

MEASURABLE PROCEDURE

PROCEDURE (:, :...)

ENDPROCEDURE

Procedure when u dont need to return value

Function when u need to return value

Both is used to shorten code when repeating part and question

demands

โ€ข INTEGER a whole number

โ€ข REAL a number capable of containing a fractional part

โ€ข CHAR a single character

โ€ข STRING a sequence of zero or more characters

โ€ข BOOLEAN the logical values TRUE and FALSE Literals

Literals of the above data types are written as follows:

โ€ข Integer written as normal in the denary system, e.g. 5, โ€“

โ€ข Real always written with at least one digit on either side of the

decimal point, zeros being added if necessary, e.g. 4.7, 0.3,

โ€ข Char a single character delimited by single quotes, e.g. ๊žŒx๊žŒ,๊žŒ@๊žŒ

โ€ข String delimited by double quotes. A string may contain no

characters (i.e. the empty string), e.g. "This is a string", ""

โ€ข Boolean TRUE, FALSE Identifiers Identifiers (the names

given to variable