O-Level-Cs - Pseudocode - Iteration - Loop Structures
O-Level-Cs - Pseudocode - Iteration - Loop Structures
Why is it important
O LEVEL IGCSE COMPUTER SCIENCE
SUBJECT CODE: 2210
ALGORITHM DESIGN AND PROBLEM SOLVING
What is Pseudocode? Why is it important?
• Pseudocode is a simple method of showing an algorithm. It describes what the
algorithm does by using English key words that are very similar to those used in
a high-level programming language.
• However, pseudocode is not bound by the strict syntax rules of a programming
language.
• But we use keywords and variables by giving meaningful names to it in the
same way we use in high level programming languages
High level
Problem Algorithm Pseudocode programming
Problem Algorithm Pseudocode
• The variable on the left of the ¨ is assigned the value of the expression on
the right. The expression on the right can be a single value or several values
combined with any of the following mathematical operators.
INPUT and OUTPUT Statement
• INPUT and OUTPUT are used for the entry of data and
display of information.
• INPUT Number
• INPUT StudentName
• INPUT Mark
• OUTPUT “Enter the name of the Student”
• OUTPUT “You are Pass”
• OUTPUT “You scored”, Mark
Problem Algorithm Pseudocode
1)Get the amount INPUT Amount
Write a
2) Find the discount Discount <- 0.2
programme to
amount DiscountPrice <- Amount *
find discounted Discount
3) Subtract the
price for a given FinalPrice<- Amount –
discount amount from
amount, DiscountPrice
the actual amount OUTPUT FinalPrice
discount is 20%
4) Output the answer
Iteration / Loop Structures
• Pseudocode includes these three different types of loop
structures
WHILE… DO…
FOR … TO … NEXT REPEAT … UNTIL ENDWHILE