Course Content
Paper 2 – Problem Solving Approach -Practical
0/102
Past Paper-2 May/June 2025
Past Paper-1 May/June 2025
Download Files
0/1
Olevel : Computer Science 2210 / IGCSE 0478 : Recorded

Stage 1 : Setting & Declaration

 

Hello students! Today, we’ll be discussing the stage of Setting and Declaration. In this stage, we define all the variables, constants, that will be used in our program. Understanding this stage is very important because it helps organize your code and ensures that your program runs smoothly right from the start.

In programming, constants and variables are fundamental concepts used to store data during the execution of a program. Both serve as named storage locations in memory, but they differ in terms of how their values behave once assigned. Understanding these two elements is essential for writing clear, efficient, and maintainable code.

 

A variable is a named data storage location that holds a value which can change during the execution of a program. Variables are declared with a specific data type (such as integer, string, or boolean), depending on the type of value they are expected to store. The value of a variable can be reassigned at any time, making variables highly useful for storing inputs, results of calculations, or dynamic data. For instance, a variable might be used to store a user’s name, count the number of attempts in a loop, or keep track of the current score in a game. Because variables are changeable, they are essential in implementing control structures such as loops and conditional statements, where values need to be updated frequently.

Forexample DECLARE TOTAL AS INTEGER. 

A constant, on the other hand, is a named data storage location whose value cannot be changed once it is initially assigned.

Like variables, constants have a specific data type and are given a name, but once set, their value remains fixed throughout the program’s execution.

Constants are often used to represent values that should not change, such as mathematical constants (for example, pie), conversion rates, or configuration settings (like, maximum login attempts or tax rates).

By using constants, programmers can avoid errors that might arise from accidental modification and also improve the readability and reliability of their code. Additionally, constants help in maintaining consistency across the program since the same value does not need to be typed repeatedly.

Forexample CONSTANT pie as REAL equals to 3.142. 

Apply the Code in Pseudocode Editor Given Below

Instructions:

  • Press the Maximize button to change it to full screen.
  • Delete sample code file from right side
  • Create new file with name of Qno1 and start writing Pseudocode 
  • Construct all the questions given in the interactive book.
  • “<-” use it to put arrows in for the assignment.
  • There are three areas: “files”, “editor”, “Console”

 

Press the “Mark as Complete” button to finish the lecture.

You cannot copy content of this page