Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Samenvatting

Summary IGCSE Computer Science (0478) Chapter 8: Programming - Clear & Concise Notes

Beoordeling
-
Verkocht
-
Pagina's
10
Geüpload op
27-08-2025
Geschreven in
2025/2026

This 10-page PDF guide covers all the essential topics for the programming section of the syllabus, including: Variables & Constants: Understand how to declare and use them in both pseudocode and Python. Data Types: A clear breakdown of INTEGER, REAL, STRING, CHAR, and BOOLEAN. Input & Output: Learn how to handle user input and display output effectively. Arithmetic & Logic Operators: Master the essential operators for calculations and decision-making. Selection: Detailed examples of IF...THEN...ELSE and CASE statements. Iteration: Clear explanations of FOR, WHILE, and REPEAT...UNTIL loops. Tottaling & Counting: Essential techniques for processing data. String Manipulation: Learn how to work with strings, including finding length and creating substrings. Subroutines: Understand the difference between Procedures and Functions, with and without parameters. Arrays: A comprehensive guide to both 1D and 2D arrays, from declaration to iteration. Library Routines: Key built-in functions like ROUND and RANDOM. -------------------------------------------------------------------------------------------------- Why you'll love these notes: Side-by-Side Examples: Instantly see the connection between pseudocode and Python code. Exam-Focused: Specifically tailored to the IGCSE 0478 Computer Science syllabus. Perfect for All Levels: Whether you're just starting or in your final revision stages, these notes will boost your confidence.

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

‭IGCSE Tuition - 0478 CS‬


‭8. Programming‬


‭8.1 Variables and Constants (Python)‬


‭Variable‬ ‭Constant‬

‭What is it?‬ ‭A named data store to contain a value‬

‭that can change‬ ‭that should stay fixed‬

‭When to use?‬ ‭ hen the data may change when the‬
W ‭ hen the data should NOT change‬
W
‭program runs‬ ‭throughout the program‬

‭How to use?‬ ‭Assign a value to it using the‬‭=‬‭sign‬

‭Naming: lowercase or snake_case‬ ‭Naming: ALL_CAPITAL_LETTERS‬

‭Example‬ ‭ core‬‭= 0‬
s ‭ I‬‭= 3.14159‬
P
‭score =‬‭score‬‭+ 5‬ ‭area =‬‭PI‬‭* 5 * 5‬
‭print(score)‬ ‭print(area)‬

‭ utput‬‭:‬
O ‭ utput‬‭:‬
O
‭5‬ ‭78.53975‬




‭Variables and Constants (Pseudocode)‬


‭Variable‬ ‭Constant‬

‭How to use?‬ ‭Declare a variable with data type using‬‭:‬‭sign‬
‭Assign a value to it using the‬‭←‬‭sign‬
‭Note: Constants do not need to be declared‬

‭Naming: PascalCase‬

‭Example‬ ‭ ECLARE‬‭StudentScore‬‭: INTEGER‬
D ‭CONSTANT‬‭InterestRate‬‭← 0.06‬
‭StudentScore‬‭← 90‬




‭Prepared by: Claudia Heng‬

,‭IGCSE Tuition - 0478 CS‬

‭8.2 Data Types‬


‭Pseudocode‬ ‭Python‬

‭INTEGER‬ ‭num_of_students = 1‬

‭REAL‬ ‭average_height = 165.5 (In Python, it is called‬‭float‬‭)‬

‭CHAR‬ ‭gender = “M” (In Python, there is no char data type, it is just‬‭string‬‭)‬

‭STRING‬ ‭student_name = “John Doe” (Either “” or ‘’)‬

‭BOOLEAN‬ ‭game_over = True / game_over = False‬




‭8.3 Input and Output‬


‭Example of input‬ ‭Pseudocode‬ ‭Python‬

‭Input without prompt‬ ‭ UTPUT‬‭“This is a Prompt”‬
O ‭surprise =‬‭input()‬
‭INPUT‬‭VariableName‬
‭Input for string‬ ‭first_name =‬‭input(‬‭“Enter your first name: ”‬‭)‬

‭Input for number/integer‬ ‭age =‬‭int(‬‭input(‬‭“Enter your age: “‬‭)‭)‬ ‬

‭Input for decimal/float‬ ‭weight =‬‭float(‬‭input(‬‭“Enter your weight: “‬‭)‬‭)‬



‭Note‬‭: You always assign a variable to the input to‬‭store the result of your input, e.g, when a user types‬
‭something to answer to your prompt, you need a storage, i.e., a variable.‬
‭Note‬‭: casting is when you convert 1 data type to another,‬‭using these functions: int(), float(), str(). input() by‬
‭default takes in the input as a string data type.‬




‭Prepared by: Claudia Heng‬

, ‭IGCSE Tuition - 0478 CS‬


‭Example of output‬ ‭Pseudocode‬ ‭Python‬

‭Output a string‬ ‭ ECLARE‬‭Name : STRING‬
D ‭ ame = "John Doe"‬
n
‭Name ← “John Doe”‬ ‭print(name)‬
‭OUTPUT‬‭Name‬ ‭or‬
‭or‬ ‭print("John Doe")‬
‭OUTPUT‬‭“John Doe”‬

‭Output a number/integer‬ ‭ ECLARE‬‭Age : INTEGER‬
D ‭ ge = 21‬
a
‭Age ← 21‬ ‭print(age)‬
‭OUTPUT‬‭Age‬

‭Output a decimal/float‬ ‭ ECLARE‬‭Height : REAL‬
D ‭ eight = 1.70‬
h
‭Height ← 1.70‬ ‭print(height)‬
‭OUTPUT‬‭Height‬

‭Output a boolean‬ ‭ ECLARE‬‭GameOver : BOOLEAN‬
D ‭ ame_over = True‬
g
‭GameOver ← TRUE‬ ‭print(game_over)‬
‭OUTPUT‬‭GameOver‬

‭ utput a combination of‬
O ‭ ECLARE‬‭Name : STRING‬
D ‭ ame = "John Doe"‬
n
‭string‬‭and a variable of‬‭string‬ ‭Name ← “John Doe”‬ ‭print(“Welcome!”, name)‬
‭data type‬ ‭OUTPUT‬‭“Welcome! ”, Name‬ ‭or‬
‭(String concatenation)‬
‭name = "John Doe"‬
‭print(“Welcome! ” + name)‬

‭ utput a combination of‬
O ‭ ECLARE‬‭Age : INTEGER‬
D ‭ ge = 21‬
a
‭string‬‭and a variable of‬ ‭Age ← 21‬ ‭print(“Your age is”, age)‬
‭integer‬‭data type‬ ‭OUTPUT‬‭“Your age is ”, Age‬ ‭or‬
‭age = 21‬
‭print(“Your age is ” +‬‭str(‬‭age‬‭)‭)‬ ‬

‭ utput a combination of‬
O ‭ ECLARE‬‭Height : REAL‬
D ‭ eight = 1.70‬
h
‭string and a variable of float‬ ‭Height ← 1.70‬ ‭print(“Your height is”, height)‬
‭data type‬ ‭OUTPUT‬‭“Your height is ”, Height‬ ‭or‬
‭height = 1.70‬
‭print(“Your height is ” +‬‭str(‬‭height‬‭)‬‭)‬



‭Note‬‭: You can use comma (,) or plus (+) sign to combine‬‭string with a data stored in variable, differences:‬
‭(i) comma adds a space automatically and plus does not, (ii) comma does not throw error when you combine‬
‭different data types whereas plus does, and you need to do casting each time)‬




‭Prepared by: Claudia Heng‬

Gekoppeld boek

Geschreven voor

Vak

Documentinformatie

Heel boek samengevat?
Nee
Wat is er van het boek samengevat?
Chapter 8
Geüpload op
27 augustus 2025
Aantal pagina's
10
Geschreven in
2025/2026
Type
SAMENVATTING

Onderwerpen

€9,81
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
hengclaudia

Maak kennis met de verkoper

Seller avatar
hengclaudia Hilti Group
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
7 maanden
Aantal volgers
0
Documenten
2
Laatst verkocht
-

0,0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Populaire documenten

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen