Algorithm
� A set of well-defined steps to perform a
task or to solve a problem
� Order is important. Steps must be
performed sequentially
Computer - programmable machine designed to
follow instructions
Program/Software - instructions that a computer
follows to perform a task
Programmer - person with the right skills who
designs, creates, and tests programs for
computers
Main Hardware Component Categories
1. Central Processing Unit (CPU)
2. Main memory (RAM)
3. Secondary storage devices
4. Input Devices
5. Output Devices
CPU's role in running programs
Fetch next instructions
Decode instruction and generate a signal
Execute: route the signal to the
appropriate component to perform an
operation
Main Memory
Holds both program instructions and data
Volatile -erased when the program
terminates or computer is turned off
Also called Random Access Memory
(RAM), because the CPU can access data
and instructions from any memory
location
Bit - smallest piece of memory
stands for binary digit
positive charge is on
negative charge is off
Byte - eight bits
-has address
Secondary Storage
- Holds data when the program is not
running
- Disk drive: Data is stored magnetically
- Optical: CD or DVD drive
- Flash
Program
a set of instructions directing a computer to
perform a task
Programming Language
A special language used to write programs
Processor dependent
1st Gen - binary form (low)
2nd gen - easy to remember, uses mnemonics, easier to remember(low)
5th - AI (high)
high level, processor independent.
3rd - branches, loops,
4th - form filling, computer aided graphics,
From high level program to executable file
1. source code --> preprocessor --> *source code --> compiler
--> machine code --> obj file --> linker --> executable file
Compiler
-translates to machine code and runs
-faster and can be executed multipletimes
-detects errors during compilation, before execution
-produces an indepndent executable file
-c, c++ , java
Interperter
-translates line by line
-slower, translates during execution
-detects errors during runtime
-executes directly
-python, javascript, ruby
Source file
contains code; the input
Object file
output of a compiler.
software development systems that provide an integrated
development environment (IDE). An IDE
has the following:
- Text editor
- Compiler
- Debugger
- Other supporting utilities
- A user interface that ties them all together
[Basically visual studio code]
Key words also known as reserved words have a special meaning in C++ and
cannot be used for other purposes. eg(for, if else, int, float)
Operators -
Arithmetic - +,-,/
Assignment - =
Logical - &&, ll , !
Relational - <>
Modeular operators - %
Punctuation - Characters that mark the end of a
statement, or that separate items in a list