0% found this document useful (0 votes)
10 views2 pages

Comprehensive Programming Exam Notes

The document provides comprehensive notes on programming concepts, covering components of computers, flowcharts, algorithms, pseudocode, error types, data types, variable naming rules, compilers, operators, decision-making statements, loops, arrays, functions, call by value and reference, recursion, and structures. It explains each concept with definitions and examples to aid understanding. This serves as a detailed guide for programming exams focusing on units 1 to 4.

Uploaded by

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

Comprehensive Programming Exam Notes

The document provides comprehensive notes on programming concepts, covering components of computers, flowcharts, algorithms, pseudocode, error types, data types, variable naming rules, compilers, operators, decision-making statements, loops, arrays, functions, call by value and reference, recursion, and structures. It explains each concept with definitions and examples to aid understanding. This serves as a detailed guide for programming exams focusing on units 1 to 4.

Uploaded by

moester988
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Programming Exam Notes – Full Detailed Version

(Units 1–4)
Components of Computer
A computer is made of different parts that work together.
Hardware: Hardware is the physical parts of a computer that we can see and touch. Examples
include keyboard, mouse, monitor and CPU.
Software: Software is a set of programs that tell the computer what to do. Examples include
Windows, MS Word and web browsers.
CPU (Central Processing Unit): CPU is the brain of the computer. It processes data, performs
calculations and controls all operations.

Flowchart
A flowchart is a graphical representation of an algorithm. It uses standard symbols to show the flow
of a program step by step. Oval represents Start/End, Parallelogram represents Input/Output,
Rectangle represents Process and Diamond represents Decision.

Algorithm
An algorithm is a step-by-step procedure to solve a problem. It must be clear, logical and finite.

Pseudocode
Pseudocode is an informal way of writing program logic using simple English. It is not a
programming language and has no strict syntax rules.

Types of Errors
Syntax Error: Errors due to wrong grammar in code.
Runtime Error: Errors that occur while the program is running.
Logical Error: Program runs successfully but gives wrong output.

Data Types
Data types specify the type of data that a variable can store. Common data types are int for
integers, float and double for decimal values, and char for characters.

Variable Naming Rules


Variable names must start with a letter or underscore. They should not contain spaces and
keywords cannot be used as variable names. Variable names are case sensitive.

Compiler
A compiler is a system software that converts high-level language into machine code. It also checks
the program for errors before execution.

Operators
Operators are symbols used to perform operations on variables. Arithmetic operators perform
mathematical operations. Relational operators compare values. Logical operators are used to
combine conditions. Assignment operator assigns values to variables.

Decision Making Statements


Decision making statements are used to make decisions based on conditions. The if statement
executes code when condition is true. The if-else statement executes one block if condition is true
and another block if false. Nested if-else contains an if-else inside another. If-else ladder checks
multiple conditions sequentially. Switch case is used when multiple fixed choices are available.

Iterative Loops
Loops are used to repeat a block of code. For loop is used when number of repetitions is known.
While loop checks condition before execution. Do-while loop executes at least once before
checking condition.

Arrays
An array is a collection of similar data items stored under one variable name. A one dimensional
array stores elements in a single list. A two dimensional array stores elements in rows and columns
like a table.

Functions
A function is a block of code that performs a specific task and can be reused. Function declaration
tells the compiler about function name and parameters. Function definition contains actual code of
the function. Function call is used to execute the function.

Call by Value and Call by Reference


In call by value, a copy of the variable is passed to the function and original value does not change.
In call by reference, the address of the variable is passed and original value can change.

Recursion
Recursion is a process in which a function calls itself until a base condition is satisfied. It is
commonly used in problems like factorial calculation.

Structure
A structure is a user-defined data type that allows storing different data types under one name. It is
commonly used to store records like student information.

You might also like