HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Computer Science
  2. /Algorithms, Programming and Logic
  3. /Programming

Programming

Computer Science · High School (9–10) · 3 courses, 30 worked problems, 30 practice questions

Programming is writing instructions that a computer can carry out. This topic covers the building blocks found in every language. Variables and constants store data of a type such as integer, real, string or Boolean. Sequence, selection and iteration control the order of steps: IF statements choose, and FOR, WHILE and REPEAT loops repeat. Arrays hold lists of values, and procedures and functions break a long program into parts. Programs also validate input, handle strings and read and write files. You practise these in pseudocode and in Python.

With practice you will be able to

  • Write a program using selection and iteration
  • Store and process data in 1D and 2D arrays
  • Break a program into procedures and functions with parameters

On the syllabus of

  • IGCSE

Lessons

  • Variables, Selection and Loops in PseudocodeHow does a program choose what to do next? How is a REPEAT loop different from WHILE?High School (9–10)
  • Procedures, Functions and Strings in PseudocodeIs a variable inside a procedure seen outside it? What makes a program easy for others to read?High School (9–10)
  • Arrays and Files in PseudocodeHow can one name hold a whole seating plan? What keeps your data after a program stops?High School (9–10)

Practice questions

Choose an answer, then check it. Each one shows a full explanation.

A quiz app stores the number of questions a player has answered so far. Which data type should it use?

Which of these is a correct literal of data type REAL in Cambridge pseudocode?

A shop packs eggs in boxes of six. DECLARE Eggs : INTEGER DECLARE Spare : INTEGER Eggs ← 29 Spare ← MOD(Eggs, 6) OUTPUT Spare What is output?

Which of these is a valid identifier in Cambridge pseudocode?

Worked problems

Each one has a hint, the key idea and a full worked solution.

  • A school library keeps a record for each book…Easy
  • A stopwatch app stores a time as a number of seconds…Medium
  • A student wrote this pseudocode to find the area of a floor in square metres and the number of…Medium
  • A café screen shows three meals: 1 for soup, 2 for pasta and 3 for salad…Easy

Python labs

  • Grades with selection
  • Totals and counts in a loop
  • Functions with parameters
  • SUBSTRING and a letter count
  • Arrays with loops
  • Saving and loading a list

Related topics

  • Algorithms, Programming and Logic
  • Algorithms and Problem-Solving
  • Databases and SQL
  • Boolean Logic

A small program works out the price of some pens. DECLARE Price : INTEGER DECLARE Pens : INTEGER Price ← 3 Pens ← 4 OUTPUT "Total: ", Price * Pens What is output?

Two values are compared with logical operators. DECLARE A : INTEGER DECLARE B : INTEGER A ← 7 B ← 3 OUTPUT (A > 5) AND NOT (B = 3) What is output?

Two loops start with the same value. DECLARE Level : INTEGER Level ← 50 WHILE Level < 20 DO Level ← Level + 10 ENDWHILE REPEAT Level ← Level + 10 UNTIL Level > 20 OUTPUT Level How many times does each loop body run, and what is output?

A countdown uses a FOR loop with a negative step. DECLARE Count : INTEGER FOR Count ← 9 TO 1 STEP -2 OUTPUT Count NEXT Count How many values are output?

The flowchart sets Count to 0 and inputs a value. While the value is not −1-1−1, it adds 1 to Count and inputs the next value. Then it outputs Count. Which loop does the flowchart show?

Every player in a league of four meets each player, and also plays one practice game alone. A program counts the games. DECLARE Home : INTEGER DECLARE Away : INTEGER DECLARE Games : INTEGER Games ← 0 FOR Home ← 1 TO 4 FOR Away ← Home TO 4 Games ← Games + 1 NEXT Away NEXT Home OUTPUT Games What is output?

All 30 practice questions on Programming →

A car park charges by the whole hour. This pseudocode works out the charge in dollars…
Medium
  • A youth club accepts members aged 11 to 16, both included. A programmer wrote…Hard
  • Ana saves money each week. This pseudocode works out her savings in dollars…Easy
  • A box office sells from 1 to 6 tickets to one person…Medium
  • This pseudocode works on a whole number that is input…Hard
  • A long scenario question. At a sports day, six runners each run 100 metres…Hard
  • A program draws borders of stars with a procedure…Easy
  • A shop's program works out sale prices in dollars…Medium
  • All 30 worked problems on Programming →