Professional Documents
Culture Documents
Variables, Constants, Literals and Data Types &ariables are identifiers of storage locations in memory that can store any value# Constants are fi'ed values# (iterals are constants that are written literally in a program Data types determine the type of data a variable can store The data types are: integers" floating point" characters and string#
1
O ned by or !nder li"en"e to Pearson #d!"ation Limited 2$$%
&lgorit'ms Step-by-step definition of a tas! or problem The characteristics of algorithms are: precise" unambiguous" finite steps" terminate# The ways to represent algorithms are: narrative" pseudocode and flowchart (ays to )epresent &lgorit'ms 2 ,ords-phrases used in pseudocode: for accepting data use read and input for storage use store and for output use write, output, display
(ays to )epresent &lgorit'ms 1 )arrative * instructions are written in plain English# $seudocode * instructions resemble programming language instructions +lowchart * diagrammatic representation of algorithms using special symbols Program Constr!"ts or Control Str!"t!res Three types * se.uencing" selection and iteration# Se.uencing is putting instructions in the order it should ta!e place Selection is ma!ing a choice between two or more options by using the decision ma!ing capabilities of computer Selection statements used in pseudocode are if-then" if-then-else epetition or iteration is used to repeat a certain process a number of times Iteration or loop statements used in pseudocode are for-endfor and whileendwhile#
Symbols used in flowcharts: %val * input-output or terminal symbol ectangle * processing hombus or diamond * decision Arrows * flow of control Small circles * connectors for sections of flowchart
2
O ned by or !nder li"en"e to Pearson #d!"ation Limited 2$$%
Revision Flashcards
Section 2 Problem-solving and Program Design
/ou can use these blan! cards to create your own revision flashcards#
3
O ned by or !nder li"en"e to Pearson #d!"ation Limited 2$$%