0% found this document useful (0 votes)
8 views7 pages

Pseudo Code

The document contains a worksheet for Cambridge IGCSE and O level Computer Science, focusing on pseudocode exercises. It includes various tasks such as inputting ages for event attendance, finding the lowest mark in an array, and validating email addresses. The content covers algorithms, loops, arrays, string handling, and validation checks.

Uploaded by

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

Pseudo Code

The document contains a worksheet for Cambridge IGCSE and O level Computer Science, focusing on pseudocode exercises. It includes various tasks such as inputting ages for event attendance, finding the lowest mark in an array, and validating email addresses. The content covers algorithms, loops, arrays, string handling, and validation checks.

Uploaded by

csekawser
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Cambridge IGCSE and O level Computer Science 2210 - Paper 2

Chapter 7 & 8 – Pseudocode Worksheet Final


1. Write an algorithm in pseudocode that inputs the ages of people entering for an event. Find out how
many persons can attend. Note that, only 18+ people can attend and the algorithm will stop if a
negative value for age is entered.
Content level – Moderate, Content cover– Counting, IF ELSE, and Repeat loop.
……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

2. A 1d array called marks [ ] denotes marks of class 9M (18 students) beginning at index 0. It
contains numbers from 0 to 100 inclusive. Write a pseudocode using a single loop to find the lowest
mark in the array and output it.
Content level – Moderate easy, Content cover – 1d Array, Minimum, FOR loop.
……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………
1
3. Write an algorithm in pseudocode that inputs some numbers and print out any numbers that are
greater than or equal to 100. The number 999 stops the algorithm.
Content level – Easy, Content cover– Maximum, while loop.
……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

3. FindHighest () is a function that returns the highest number of an array. Write an algorithm in
pseudocode to perform for this operation.
Content level – Hard, Content cover– Subroutine (Function).
……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………
2
……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

4. Write pseudocode statements to:

1. Store the string "Programming is fun" in X.


2. Find the length of the string and output it.
3. Extract the word fun from the string and output it.
4. Convert fun in uppercase and output it.

Content level – Moderate, Content cover – String handling

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

5. Write an algorithm in pseudocode to take 50 student names along with their father name stored in a
2D array called Admission []. The contents of the array than output.

Content level – Hard, Content Cover – 2D array.

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

3
……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

6. An email address must satisfy these conditions:

 It must contain the “@” symbol.


 It must end with “.com”
 It must be at least 10 characters long.

Content level – Moderate Hard, Content cover – Validation Checks.

(a) Identify three validation checks to ensure the email address is valid.

Check 1:
…………………………………………………………………………………………………………....

Reason:
…………………………………………………………………………………………………………….

Check 2:
……………………………………………………………………………………………………………

Reason:
…………………………………………………………………………………………………………….

Check 3:
……………………………………………………………………………………………………………

Reason:
……………………………………………………………………………………………………………..

4
(b) Assume the email is stored in a variable called Email.

Write pseudocode to check whether the email contains the "@" symbol.

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

(c) Write pseudocode to check whether the @ symbol is present or not.

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

(d) Write pseudocode to make sure the email must be exactly 10 characters in length.

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

5
7. Write an algorithm in pseudocode to find out if Mr. Kawser is an employee of CGS. Note that CGS
has 100 teachers, if he is a teacher than print “Found” otherwise print “Not found”.

Content level – Moderate, Content cover – Linear search.

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

6
8. Write an algorithm in pseudocode to sort a list of ten temperatures stored in the array temperature [],
into ascending order.

Content level – Moderate, Content cover – Bubble sort, 1D Array.

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

You might also like