Edp101l Finalreviewer

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

A.

Introduction to Computer Classification


Computer
- Programmable machine to follow (1) According to Functionality (ADH)
instructions
- Data (input) a. Analog
- Information (output) - Real time (many signals) operation
Program - Simultaneously computation
- Instruction in computer to make it do (Transformation of the problematic
something equations into the analog computer
Programmer circuit).
- Person who program to make comp
perform a task b. Digital
- Easy information storage
Characteristics - Great flexibility
(1) Speed (perform multiple task)
- microseconds, nanoseconds, and ever
picoseconds c. Hybrid
(2) Accuracy - Both analog and digital
-GIGO- Garbage in Garbage out (analog= handle complex mathematical
=wrong input=wrong output computations.)
(3) Diligence (digital=take care of logical, numerical
- Work without any break operations, and controller for the
(4) No feeling system.
(5) No IQ
- Don’t work if no instructions. (2) According to Size (Mic,Min,Main,Sup)
(6) Power of Remembering
(7) Versatility a. Micro Computer (Pc)
- Can work anything at one time - Easy to use and low computing.
(8) Storage - Desktop and portable computers
- 1 Single chip (CPU – brain)
Generations (VTIMA)
- Integrated Circuit Fabrication
1st – Vacuum Tubes (1940-1956) technology
o Circuitry and magnetic drum for
memory b. Mini-Computer
o Taking up entire room - Lies between the micro and mainframe.
o Generate a lot of heat. - 12inches in width to less than 7
- Ex. Students; tablet pc, desktop mini,
2nd – Transistors (1956-1963) cp, nb, etc.
o Replacement of vacuum tubes
o 3 tiil c. MainFrame Computer
o Invented first in 1947 - Most stable and secured.
rd
3 – Integrated Circuit (IC) (1964-1971) - Process large amounts of data
o Transistors put in - Ex. Credit card
semicond./silicon chips
o First comp = keyboard and d. Super-Computer
monitor - Fastest and powerful
4th – Microprocessors (1972-2010) - Push the limits of computational speed
o Intel - Scientific and engineering
o All computer components in
single chip (CPU, memory,
input/output controls).
o Develop in 1971
o GUI- Graphical user interface
o 1984, Macintosh Apple
5th – Artificial Intelligence (2011-present)
o Google Now
o Image recognition
o Smart assistants
Computer Hardware (3) Secondary storages
Non-volatile – date retained when program
is not running or if computer is turned off
Magnetic: hdd
optical: cd or dvc
flash: USB flash drive

(4) Input devices


- To the computer from outside
- Keyboard, mouse, mic, scanner, digi
cam. Disk drive, cd/dvd, flash drive

(1) CPU- Central processing unit


(5) Output devices
a. Control Unit - From the computer to outside
- Retrieve and code the program - Screen, printer, speakers, disk drive,
instructions. cd/dvd recorded, USB

b. ALU (arithmetic and logic unit)


- Perform mathematical equations
ROLE: Software
I. Fetch - Set of instruction
- Get the instruction from main memory - Apps, scripts, and programs
II. Decode
- Interpret the instruction and create a (1) Operating system software
signal - Programs that manage the computer
III. Execute hardware and the program that run on
- Route signal to perform and operation the computer.
- Windows, Lunix, Mac

(2) Application software


- Programs that provide services to the
user
- EX: MS, games,

Programming Language

(2) RAM- Random access memory/ main - A language used to write programs.
memory Types
- Hold both programs instruction and
data. (1) Low-level
- Volatile= erased when program - Used for communication with computer
terminates or computer is off hardware directly
(2) High level
Main memory organization - Closer to human language

Ex: C++. Java, DevC++, Visual Basic


Bit (Binary Digit)
- Smallest piece of memory
- 0- off, 1-on
Byte
- 8 consecutive bits
- number of bits= single character of text
in computer
Word
- 4 consecutive bytes = 32 bits
Algorithm

- Step by step method of solving a Example:


problem. It is commonly used for data
1. Get the length of the rectangle.
processing, calculation, and other
2. Get the width of the rectangle.
related computer and mathematical
3. Find the perimeter using the
operations. An algorithm is also used to
Perimeter=2(L+w).
manipulate data in various ways, such
4. Find the area using the area=l*w.
as inserting a new data item, searching
5. Display the result.
for a particular topic, or sorting an item.

Pseudocode

- is an informal program description that


does not contain code syntax or
underlying technology considerations.
It summarizes the program flow but Example:
excludes underlying programming Begin
details. Often at times, algorithms are Input length, width
represented with the help of pseudo Perimeter= 2(L+W)
codes as they can be interpreted by Area=L*w
programmers no matter what their Print Perimeter
programming background or knowledge Print Area
is. Pseudo code, as the name suggests, End
is a false code or a representation of
code which can be understood by even
a layman with some school level
programming knowledge.

Flowchart

- is a graphical representation of an
algorithm. It is usually drawn using
certain special-purpose symbols
connected by arrows called flow lines.
Table 7 shows the basic flowchart
symbols with its equivalent meaning.

Terminal

Input/Output

Process

Initialization

Offpag onpa
econne gecon
ctor necto
r

Deci
sion
== Equal to
!= Not equal to
< Less than
<= Less than and equal
to
>
>=
! Not
&& And
|| Or

x=15, y=7, z=-5


(x>y) && (y>z) T
(x>z) && (z>y) F
(x<=z) || (y==z) F
(x<=z) || (y!=x) T
!(x>=y) F

#include<iomanip>
#include<cmath>||<math.h>
pow (x, y) Pow (base, exponent) pow (4, 2)
log (x) Natural log of x log (5)
exp (x) Exponential value of x exp (5)
cos (x) Cosine of x cos (60)
sin (x) Sine of x Sin (60)
tan (x) Tan of x tan (60)
acos (x) Arccos of x acos (60)
asin (x) Arcsin of x asin (60)
atan (x) Archtan of x atan (60)
fabs (x) Abs value of x fabs (-10)
sqrt (x) Square root of x sqrt (10)

+ Addition X+y
- Subtraction X–y
* Multiplication X*y
/ Division X/y
% Modulus division X&y

*M_PI stands for constant PI


*Answers for trigo function will return to radian
*Multiply the angle to (M_PI/180)

control the output of cout<<setprecision(3)


setprecision(n) floating points numbers
Set to output in fixed cout<<fixed
fixed decimal format until it
is disabled
To force the output to cout<<showpoint
showpoint show the decimal point
and trailing zeroes.
To output the value of cout<<setw(10)
setw(n) an expression in a
specific number of
columns and is rigjt-
justified.
CONDITIONAL STATEMENTS: IF/ELSE IF

One-way selection: if
If (expression)
Statement;
True=execute
False=does not execute, go next statement

Two-way selection: if/else


If (expression)
Statement;
else
Statement;
Else= if above condition is false
Take only one of two possible paths

Multiple Selection: Nested if -if/else if/else

if (condition1)

Statement/s;

else if (condition 2)

Statement/s;

else if (condition 3)

Statement/s;

else

CONDITIONAL STATEMENTS: SWITCH


-does not require the evaluation of a logical
expression
-to choose from among many alternative

switch (expression)
{
case value1;
statements1;
break;
case value2;
statements2;
break;
default:
statements;
}
= does not match any of the case, default
execute.
=if does not match any of the case, and no
default, the switch statements skipped.
=break, immediate exit from the switch
LOOPING STRUCTURE

- || iteration or repetition
- sequence of instructions that is
continually repeated until a certain
condition is satisfied.

Initialization. it sets the initialization value


of the control variable or sometimes called
counter, of the loop.

condition. check the value of the source;


body of loop executed if condition is true.

updater. updates and modify the value of


the counter/loop. (x++ incre..|| x—decre..),
loop continuation until becomes false.

(1) while loop – pre-test loop


- test the condition at the beginning of
the loop before executing the body of
the loop. if condition is false, loop never
executes.

Initialization;
while (condition)
{
statements;
updater;
}

(2) do-while loop – post test loop


- test the condition after executing the
loop’s body. The loop body always
execute at least once.

Initialization;
do
{
statements;
updater;
} while (condition);

(3) for loop – pre-determined loop

for (initialization; condition; updater)


{
statements;
}
Arrays. Single-Dimension

- variable that can store multiple values


of the same type.
- stored in adjacent memory locations.

[]

ex:

int= data type of the array

tests= name of the array

ISIZE= size declarator, shows number of


elements in the array

You might also like