Oop Intro
Oop Intro
Program is created in
Editor Disk the editor and stored
on disk.
1. Edit it on disk.
3. Compile
Primary
Memory
Loader
5. Load Disk ..
..
..
6. Execute Primary
Memory
CPU CPU takes each
instruction and
executes it, possibly
storing new data
values as the program
.. executes.
..
..
C++ Programs
Variables, as their name implies, are data whose values can change
during the course of execution of your program.
For both constants and variables, the name, the data type, and
value must be specified.
- On separate lines:
int length;
int width;
unsigned int area;
int x; // Declare x to be an
// integer variable;
char a; // Declare a to be a
// character variable;
• Variable names correspond to locations in
the computer's memory.
– Every variable has a name, a type, a size and a
value.
– Whenever a new value is placed into a variable, it
replaces the previous value - it is destroyed
– reading variables from memory does not change them
• A visual representation
no1 45
Variable Assignments and Initialization
Assignment
variable = expression ;
a= 10+20;
item = 12; // constant
Celsius = (Fahrenheit - 32) * 5 / 9; // expression
y = m * x + b; // expression
Assignment Statement
Initialization