Beruflich Dokumente
Kultur Dokumente
SECTION 2 OF SYLLABUS: CHAPTER 29: Problem Solving and Programming – Computer Based
Activity # 29 – a
Possible Solution:
INPUT PROCESSING OUTPUT
• Length •Area = Length * Width
• Width
•Area
(ii) Calculate the results of ten students and find the average. (5 marks)
Possible Solution:
INPUT PROCESSING OUTPUT
• Ten Students •Sum = Ten Students •Average
•Average = Sum / 10
Possible Solution:
INPUT PROCESSING OUTPUT
• Number 1 •SQUARE = Number 1 *
• Number 2
•SQUARE
Number 2
Possible Solution:
1
Information Technology in FOCUS for CSEC
SECTION 2 OF SYLLABUS: CHAPTER 29: Problem Solving and Programming – Computer Based
Possible Solution:
In computer science an algorithm is a step by step method of solving a problem. It is commonly
used for data processing, calculation and other related computer and mathematical operations.
An algorithm is also used to manipulate data in various ways, such as inserting a new data item,
searching for a particular item or sorting an item.
Possible Solution:
a valid input that is clearly outlined
Unambiguous steps, must be specific
Finite number of steps, steps must be limited
Control flow. Must flow easily from one step to another
A terminator or terminates after a finite number of steps are completed
An appropriate Output within steps. The result of the solution must relate to the input
Possible Solution:
a) Narrative
b) Pseudocode
c) Flowchart
Possible Solution:
(i) Algorithm is a step by step method of solving a problem. It is commonly used for
data processing, calculation and other related computer and mathematical
operations.
2
Information Technology in FOCUS for CSEC
SECTION 2 OF SYLLABUS: CHAPTER 29: Problem Solving and Programming – Computer Based
(v) Control flow. Must flow easily from one step to another
(vii) An appropriate Output within steps. The result of the solution must relate
to the input
TOTAL 35 MARKS
Activity # 30 - b
TEST YOUR KNOWLEDGE
Chapter 30: Problem Solving and Programming – Computer Base
Possible Solution:
Narrative is writing algorithms in plain English statements. These statements are written in
steps that are clear, precise and are easy to understand. This is similar to writing in the IPO
Chart .
Possible Solution:
Step 1: Start
Step 2: Accept Length and Width
Step 3: Store Length and Width in Area
Step 4: Store result in Area
Step 5: Display Area
Step 5: Stop
3
Information Technology in FOCUS for CSEC
SECTION 2 OF SYLLABUS: CHAPTER 29: Problem Solving and Programming – Computer Based
(ii) Calculate the results of ten students and find the average. (5 marks)
Possible Solution:
Step 1: Start
Step 2: Accept ten students
Step 3: Store ten students in Sum
Step 3: Divide sum by 10
Step 4: Store result in Average
Step 5: Display Average
Step 5: Stop
Possible Solution:
Pseudocode is an informal program description of a program. Pseudocode contains what is
called syntax. Pseudocode summarizes a program’s steps (or flow) but excludes underlying
details.
Possible Solution:
Statements are written in plain English
Each instruction is written on a separate line
Keywords (IF, ELSE, FOR, WHILE etc.)and indentation are used to signify particular control
structures
Each set of instructions is written from top to bottom, with only one entry and one exit
Groups of statements may be formed then given a name
Possible Solution:
Step 1: Start
Step 2: Accept 100 students’ marks
Step 3: Store 100 students’ in Sum
Step 3: Divide sum by 100
Step 4: Store result in Average
Step 5: Display Average
Step 5: Stop
4
Information Technology in FOCUS for CSEC
SECTION 2 OF SYLLABUS: CHAPTER 29: Problem Solving and Programming – Computer Based
Possible Solution:
Step 1: Start
Step 2: Accept Number 1 and Number 2
Step 3: Multiply Number 1 by Number 2
Step 4: Store result in SQUARE
Step 5: Display SQUARE
Step 5: Stop
Possible Solution:
In programming, a variable is a value that can change, depending on conditions or on
information passed to the program. Typically, a program consists of instructions that tell the
computer what to do and data that the program uses when it is running.
A constant is classified as a variable whose value cannot be changed once it has been assigned. For
example pi is equal to 3.124; 25 mm is equal to 1” (I inch).
Possible Solution:
Constant Variable Name Value in Pseudocode as:
Pi 3.142
Year 2014
Date of birth 03.5.82
Amount $100.00
7. Give TWO examples of Relational Operator and Boolean Logical Operators. (4 marks)
Possible Solution:
Operation Meaning RELATIONAL Operator
Greater than >
greater than or equal to >=
Less than <
less than or equal to <=
5
Information Technology in FOCUS for CSEC
SECTION 2 OF SYLLABUS: CHAPTER 29: Problem Solving and Programming – Computer Based
A B A OR B
1 1
1 0
0 0
0 0
Possible Solution:
A B A OR B
1 1 1
1 0 1
0 0 0
0 0 0
Possible Solution:
The BODMAS is a rule of expression in mathematics. The acronym stands for:
a) B – Brackets
b) O – Order
c) D – Division
d) M – Multiplication
e) A – Addition
f) S–Subtraction
Possible Solution:
Sequence
6
Information Technology in FOCUS for CSEC
SECTION 2 OF SYLLABUS: CHAPTER 29: Problem Solving and Programming – Computer Based
Selection
Iteration also called repetition
Possible Solution:
SEQUENCING
Sequence tends to refer to the order of executing statements. In sequencing, one of a number
of statements is executed depending on the condition of the program.
SELECTION
The selection statement is also called a conditional statement or a logic statement. This
statement in Pseudocode is used to make a decision between alternatives.
Possible Solution:
A repetition statement is called a looping statement, iteration statement or simply a loop. It is
the process wherein a set of instructions or structures are repeated in a sequence, a specified
number of times or until a condition is met.
Possible Solution:
FOR DO
WHILE DO
REPEAT UNTIL
Possible Solution:
Conditional statement or a logic statement
7
Information Technology in FOCUS for CSEC
SECTION 2 OF SYLLABUS: CHAPTER 29: Problem Solving and Programming – Computer Based
Possible Solution:
(i) Narrative is writing algorithms in plain English statements. These statements are written
in steps that are clear, precise and are easy to understand. This is similar to writing in
the IPO Chart .
(ii) The first Print is used to ask a user to enter data in an algorithm. Whenever, print is used
in this manner, it is called a Prompting Statement.
(iii) Print is also used to output information from an algorithm. By using Print in this manner,
it is called an output statement.
(iv) After writing the prompting statement, the next step is to accept the data entered. This
is where the Read statement comes in.
(v) a variable is a value that can change, depending on conditions or on information passed
to the program.
(vi) Numeric variable are variables whose values are numbers that can be changed. These
values are displayed in standard numeric format. For example, 23, 45, 4, 6, etc.
(vii) Character Variable are variables whose values are characters. These characters
can change and have a standard character format. For example A, D, a, num, c, C.
(viii) A constant is classified as a variable whose value cannot be changed once it has
been assigned.
(ix) A single character constant or character constant is a single alphabet, a single digit or a
single special symbol enclosed within single inverted commas.
(x) A string literal contains a sequence of characters enclosed in double quotation mark
symbols.
(xi) An integer is a whole number (not a fractional number) that can be positive, negative, or
zero.
(xii)A character is any letter, number, space, punctuation mark, or symbol that can be typed
on a computer.
(xiii) The term floating point is derived from the fact that there is no fixed number of
digits before and after the decimal point, i.e. the decimal point can float.
(xiv) A string is any series of text characters, such as letters, numbers, special
characters, and spaces or simply a group of alphanumeric characters.
(xv)Operators are special symbols which indicate that a certain process is carried out.
(xvi) A relational operator compares two operands or two variables to determine
whether one is greater than, greater than or equal to, less than, less than or equal to the
other
(xvii) The term Boolean generally means TRUE and FALSE. These are simply similar to
1's (for true) and 0's (for false).
(xviii) A truth table is a breakdown of a logic function by listing all possible values the
function can attain.
(xix) An arithmetic operator is a mathematical function that takes two operands and
performs a calculation on them.
8
Information Technology in FOCUS for CSEC
SECTION 2 OF SYLLABUS: CHAPTER 29: Problem Solving and Programming – Computer Based
TOTAL 73 MARKS