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

Memory Identifiers & Problem Solving

Uploaded by

misbahayaz714
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)
4 views14 pages

Memory Identifiers & Problem Solving

Uploaded by

misbahayaz714
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

Memory Identifiers & Problem

Solving Methods
Computer Science (Paper 2 –
Pseudocode & Python)
Prepared by: Your Name
Memory Identifiers
• Definition: Memory identifiers are names
given to memory locations to store data.

• Types:
• 1. Variable
• 2. Constant
• 3. Arrays
• 4. Records
Variables
• Definition: Stores one piece of data that can
change during execution.

• Python Example:
• x = 10
• x = x + 5 # value changed to 15

• Pseudocode:
• DECLARE x : INTEGER
Constants
• Definition: Stores one piece of data that
cannot be changed during execution.

• Python Example:
• PI = 3.14159

• Pseudocode:
• CONSTANT PI = 3.14159
Arrays
• Definition: Stores multiple values of the same
data type under one name.

• Python Example:
• marks = [85, 90, 78, 92]
• print(marks[2]) # Output: 78

• Pseudocode:
• DECLARE marks : ARRAY[1:4] OF INTEGER
Records
• Definition: Stores multiple values of different
data types under one name.

• Python Example:
• student = { 'name': 'Aqib', 'age': 18, 'grade': 'A'
}

• Pseudocode:
• TYPE Student
Problem Solving Methods
• 1. Flowchart
• 2. Structured English
• 3. Algorithm
• 4. Top-down Design
• 5. Structured Diagram
• 6. Source Code
Flowchart
• Graphical representation of logic using
symbols.

• Example: Find the largest of 2 numbers.


• (Include flowchart diagram here)
Structured English
• Step-by-step written explanation in plain
English.

• Example:
• IF number is greater than 0
• THEN print 'Positive'
• ELSE
• print 'Negative'
Algorithm
• Step-by-step process written in pseudocode.

• Example: Find max of 2 numbers.

• INPUT A, B
• IF A > B THEN
• OUTPUT A
• ELSE
• OUTPUT B
Top-Down Design
• Breaking the problem into smaller sub-
problems.

• Example: ATM System


• - Main Process → Withdraw Money
• - Subprocess 1: Verify PIN
• - Subprocess 2: Check Balance
• - Subprocess 3: Dispense Cash
Structured Diagram
• Hierarchical diagram showing problem
decomposition.

• Example: ATM → Verify PIN, Check Balance,


Dispense Money
Source Code
• Final implementation in Python.

• a = int(input('Enter first number: '))


• b = int(input('Enter second number: '))
• if a > b:
• print('Max is', a)
• else:
• print('Max is', b)
Summary
• • Memory Identifiers → Variable, Constant,
Array, Record
• • Problem Solving → Flowchart, Structured
English, Algorithm, Top-down Design,
Structured Diagram, Source Code
• • Pseudocode + Python examples covered

You might also like