0% found this document useful (0 votes)
2 views14 pages

Variables in Pseudocode

The document explains the importance of variables in pseudocode, which are essential for storing and manipulating data within algorithms. It covers how to declare variables, the different data types (integer, float, string, boolean, complex), and provides examples of each. Additionally, it discusses best practices for naming variables to enhance code readability and maintainability.

Uploaded by

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

Variables in Pseudocode

The document explains the importance of variables in pseudocode, which are essential for storing and manipulating data within algorithms. It covers how to declare variables, the different data types (integer, float, string, boolean, complex), and provides examples of each. Additionally, it discusses best practices for naming variables to enhance code readability and maintainability.

Uploaded by

raphybolhano2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

VARIABLES IN PSEUDOCODE

VARIABLES IN PSEUDOCODE

Are fundamental components in


programming and pseudocode. They
are used to store and manipulate data
within an algorithm. Understanding how
to use variables is crucial for writing
effective pseudocode.
DECLARING VARIABLES
In pseudocode, variable declaration is
typically less formal than in actual
programming languages. You can simply
use a variable by assigning a value to it. The
common syntax is:
variable = value
USING VARIABLES

Variable are use to store information


that the program needs to work with
such as numbers,text,and other day
types. Variable is a storage location
with assigned name and hold data
that you can change or use later on.
DATA TYPES
• Integer: Whole numbers (e.g., 10, -5, 100).
• Float (Decimal/Real Numbers): Numbers with
decimal points (e.g., 3.14, -0.99).
• String: A sequence of characters (e.g., "Hello",
"123").
• Boolean: Represents True or False.
• Complex: Used in mathematical calculations with
imaginary numbers (e.g., 2 + 3j in Python).
EXAMPLES OF DATA TYPES
• Here are examples for each data type:
• 1. Integer (Whole Numbers)
• 10
• -5
• 1000
• 2. Float (Decimal Numbers)
• 3.14
• -0.99
• 100.5
• 3. String (Text)
• "Hello, World!"
• '123' (even though it contains numbers, it is a string)
• "John Doe"
• 4. Boolean (True/False)
• True
• False
• 5. Complex Number (Used in Mathematics)
• 2 + 3j (Python notation for complex numbers)
• -4 + 0.5j
VARIABLE NAMING CONVENTIONS

Variable naming conventions help make


code more readable and maintainable.
When naming variables in pseudocode, it's
good to:

Use descriptive names (e.g., 'total_score' instead of 'ts')


Example: ts = 90

✅ total_score = 90
*Use lowercase letters and underscores for readability
Example: TS = 90
TotalScore = 90

✅ total_score = 90
*Avoid using reserve keywords as variable names
Example: class = "math"

✅ Student _ class = "math"


GROUP 1 MEMBERS

ACERA, CAMUEL C.
BOLHNO, RAPHY F.
ENGRACIA, MARK JHON PAUL M.
JEREZ, RAFY T.
SAYSON, RODEL E

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy