Computer Science - 9210 OxfordAQA

Relational Operations In A Programming Language

Overview

A pass mark of 40 sounds like the least ambiguous instruction in education until somebody has to write it down as a condition. Is 40 a pass? If the code says the mark must be greater than 40 then it is not, and every candidate on exactly 40 has just been failed by a single character. Relational operations are where a specification in English turns into a decision a machine makes, and the whole topic lives on that boundary.

This lesson covers the six comparisons the specification names, the exact symbols that assessment material uses for them, and the fact that every one of them produces a Boolean and nothing else. You will learn how comparison works on text as well as on numbers, why comparing two real numbers for exact equality is a trap, and how the six pair up into opposites so that you can negate any condition without thinking twice about it.

Objectives

  1. Be familiar with and be able to use:
  2. equal to
  3. not equal to
  4. less than
  5. greater than
  6. less than or equal to
  7. greater than or equal to.
  8. In assessment material we will use the following symbols: =, ≠, <, >, ≤, ≥

Mind map

This topic is mapped out so you can see how the ideas connect.

Open the mind map in the app

Lesson Note

A relational operation compares two values and produces True or False. That is all it does, and it is enough to drive every decision in every program: an IF acts on the result, a WHILE keeps looping on the result, and a search algorithm decides which half of an array to discard on the result.

Complete Note Available on the Green Bridge App

Get the Green Bridge CBT app on your phone or computer for the complete IGCSE library: past papers, mark schemes, mind maps, flashcards and audio lessons.

Full lesson notes with diagrams
AI-powered learning assistant
Timed mock exams marked the moment you finish
Available on Android, Windows, macOS, and Linux iOS app coming soon

Lesson Evaluation

Congratulations on completing the lesson on Relational Operations In A Programming Language. Now that youve explored the key concepts and ideas, its time to put your knowledge to the test. This section offers a variety of practice questions designed to reinforce your understanding and help you gauge your grasp of the material.

You will encounter a mix of question types, including multiple-choice questions, short answer questions, and essay questions. Each question is thoughtfully crafted to assess different aspects of your knowledge and critical thinking skills.

Use this evaluation section as an opportunity to reinforce your understanding of the topic and to identify any areas where you may need additional study. Don't be discouraged by any challenges you encounter; instead, view them as opportunities for growth and improvement.

  1. A holds 8 and B holds 8. Which expression is True? A. A < B B. A > B C. A ≥ B D. A ≠ B Answer: C
  2. Which condition correctly tests the rule that a temperature of 100 degrees or above triggers an alarm? A. Temperature < 100 B. Temperature ≤ 100 C. Temperature > 100 D. Temperature ≥ 100 Answer: D
  3. What is the exact opposite of the condition Count < 10? A. Count > 10 B. Count ≥ 10 C. Count ≤ 10 D. Count ≠ 10 Answer: B
  4. An array holds 20 items. Which loop condition visits every item exactly once, with Index starting at 0? A. Index < 20 B. Index ≤ 20 C. Index < 19 D. Index ≠ 21 Answer: A
  5. Two strings are compared. Which statement is correct? A. The longer string is always the greater B. Strings can only be tested for equality C. Strings are compared character by character using character codes D. Capital letters and lower case letters compare as equal Answer: C

Work through these questions in the app

Work through these questions in the app

Practice Mock Questions

Want to practice mock questions on Relational Operations In A Programming Language? Download the Green Bridge CBT app to access mock questions and full practice assessments for this topic.

Download The App On Google Playstore

Everything you need to excel in your exams

Green Bridge CBT Mobile App
Personalized AI Learning Chat Assistant
200,000+ Exam Questions Across IGCSE, JAMB, WAEC & NECO
Over 3,900 Lesson Notes
Offline Support - Learn Anytime, Anywhere
Green Bridge Timetable
Literature Summaries & Potential Questions
Track Your Performance & Progress
In-depth Explanations for Comprehensive Learning