0% found this document useful (0 votes)
20 views11 pages

TLE 1st Quarter Reviewer

Uploaded by

hershannn
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)
20 views11 pages

TLE 1st Quarter Reviewer

Uploaded by

hershannn
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
You are on page 1/ 11

HISTORY OF COMPUTER - Jean-Baptiste Falcon

PROGRAMMING (1728)
- Jacques Vaucanson
(1740)
Programming Language
- Bouchon’s invention did not
- Language for describing
have much success because
instructions that a computer
the number of needles was
can follow to solve a problem
not sufficient to allow the
- Has a grammar (or syntax)
weaving of large designs and
that programmers learn
he used a roll of paper which
- Computers cannot
was not very practical
understand a program if the
- The looms of Bouchon and
syntax is even slightly
Falcon eliminated mistakes in
incorrect and will complain
the lifting of threads but still
with a ‘syntax error’
needed and extra operator or
Central Processing Unit (CPU)
even two of them to operate
- Can only perform simple
- The loom of Bouchon and
instructions can do them very
Falcon was modestly
fast
successful: about 40 such
- Can add two whole numbers
looms had been sold by 1762
together billions of times per
- The first first attempt at full
second but cannot recognize
automation was made by
a handwritten digit
Jacques Vaucanson in 1745,
- To recognize handwriting,
not very successful
programmers must break the
- Until 1805 that the widely
task down into many simple
Jacquard loom was finally
instructions for the computer
produced
to follow.
Charles Babbage
Joseph Marie Charles
(December 26, 1791 - October 18,
(July 7, 1752 - August 7, 1834)
1871)
- French weaver and merchant
- Mathematician, philosopher,
- Invented the Jacquard Loom
inventor, and mechanical
The Jacquard Loom
engineer
- Mechanical loom that uses
- “The Father of Computer”
pasteboard cards with
- Inventor of Difference Engine
punched holes and each card
No.1 and Analytical Engine
corresponding to one row of
Difference Engine No.1
the design
- Charles Babbage’s first
- Multiple rows of holes are
machine
punched in the cards and the
- An early calculating machine
many cards that compose
verging on being the first
the design of the textile are
computer, designed and
strung together in order
partially built during the
- Based on earlier inventions by
1820s and ‘30s
the Frenchmen:
- Designed to automatically
- Basile Bouchon (1725)
calculate and tabulate
mathematical functions
called polynomials which for Charles Babbage’s unbuilt
have powerful general Analytical Engine
applications in mathematics - Published a sequence of
and engineering steps to perform using a
- Babbage worked closely with computing machine
Joseph Clement, a master designed by her friend,
toolmaker and draftsman Charles Babbage
who was tasked with making Herman Hollerith
the parts (February 29, 1860 - November 17,
- The Difference Engine No.1 1929)
had 25,000 parts and - An American businessman,
weighed four tons inventor, and statistician
Analytical Engine - Inventor of the tabulating
- Considered the first machine
computer - His invention of the punched
- Designed and partly built by card tabulating machine,
Babbage in the 19th Century patented in 1884, marks the
(he worked on it until his beginning of the era of semi
death in 1871 automatic data processing
- The only parts that were systems, and his concept
assembled were in 1833 as a dominated that landscape for
demonstration piece for the nearly a century
Government and can be seen Tabulating Machine
now in the Science Museum - Electromechanical machine
in London designed to assist in
Joseph Clement summarizing information
(June 13, 1779 - February 28, 1844) stored on punched cards
- First Computer Engineer - Was developed to help
- A British engineer and process data for the 1890 U.S.
industrialists, chiefly Census
remembered as the maker of - Later models were widely
Charles Babbage’s first used for business
Difference Engine between applications (accounting,
1824 and 1833 inventory control)
Augusta Ada King, Countess of - Spawned a class of machines,
Lovelace Byron known as unit record
(December 10, 1815 - November 27, equipment, and the data
1852) processing industry.
- First Computer Programmer Alan Mathison Turing
- English mathematician and (June 23, 1912 - June 7, 1954)
writer - English mathematician,
- 1843: Ada Lovelace became computer scientist
the first person to publish a - Father of Theoretical
computer program, a set of Computer Science and
instructions to calculate Artificial Intelligence
Bernoulli’s Numbers, written
- Provided a formalisation of Gottfried Leibniz
the concepts of algorithm (July 1, 1646 - November 14, 1716)
and computation - German mathematician and
Turing Machine philosopher
- Model of a general-purpose - Most prolific inventor in the
computer field of mechanical calculator
- Mathematical model of - Invented and refined the
computation that defines an binary number system, which
abstract machines which is at the foundation of
manipulates symbols on a virtually all digital computers
strip of tape according to a
table of rules UNDERSTANDING
- Capable of stimulating the
ALGORITHM
algorithm’s logic can be
constructed
Algorithm
John Warner Backus
- Step-by-step procedure in
(December 3, 1924 - March 17,
solving a problem
2007)
- Finite set of instructions that
- Directed the team that
specify a sequence of
invented an implement
instructions
FORTRAN, the first widely
Programming Algorithm
used High-Level
- Set of instructions/rules to be
Programming Language
followed by a computer
Examples of Programming
program
Language:
- Contains an Input, process,
1. C#
and output depending on the
2. C++
problem solved
3. Php
IPO Model
4. Java
● Input→Process→Output
5. JavaScript
Variables
6. Swift
- Math: letter that can
7. Python
represent any number
- Programming: letter/word
BINARY
that serve as a temporary
storage that can represent
Binary
any value
- A base -2 number system
invented by Gottfried Leibniz
CHARACTERISTICS OF
- Made up of only 0 and 1
- Basis for all binary code, ALGORITHM
which is used to write data
such as the computer 1. Input
processor instructions used - zero(0) to more
every day 2. Output
- At least one (1)
3. Definiteness Problem 2: Create a program that
- Instructions must be clear will display the average of 2
and realistic numbers
4. Finiteness 1. Declare 4 variable, 2 for the
- Must terminate and should addends, 1 for the sum, and 1
have a stopping point for the average
5. Effectiveness 2. Let the user input the
- Instructions must be efficient addends
and useful 3. Perform the addition
GENERAL FORMAT: between the addends and
1. Declare a variable (content assign it to the sum
and amount depends on the 4. Divide the sum by 2
problem) 5. Display the average
2. Let the user input (content Problem 3: Create a program that
depends on the problem) will display Even or Odd
3. Perform (process depends on depending on the number
the problem) inputted by the user
4. Perform (process depends on 1. Declare a variable
the problem) 2. Let the user input the
5. Display (content depends on number
the problem) 3. If the number is even, display
“Even”
Note: 1, 2 and 5 are always 4. If the number is odd, display
constant, 1 is always to declare a “Odd”
variable and 2 is always letting Problem 4: Create a program that
the user input something and 5 is will display the greater between 2
for displaying the output. numbers
Note: Number of steps for a 1. Declare 2 variables. Let
problem depends on the problem variables be num1 and num2
2. Let the user input the
REMEMBER: the last step of the number
process is always “End Program” 3. If num1 is greater than num 2,
display “greater is”, num 1
ALGORITHM EXAMPLES: 4. If num2 is greater than num1,
display “greater is”, num2
Problem 1: Creates a program that Problem 5: Create a program that
will display the sum of 2 numbers will display the Gender
1. Declare 3 variables, 2 for the depending on the inputted
addends, and 1 for the sum variable of the user. Display Male
(input) or Female. If not display Qplus
2. Let the user input the 1. Declare a variable for Gender
addends (process) 2. Let the user input the Gender
3. Perform the addition 3. If the gender is Male, display
between the addends and “Male”
assign it the sum (process) 4. If the gender is Female,
4. Display the Sum display “Female”
5. If the Gender is not Male or PSEUDOCODES EXAMPLE:
Female, display “Qplus”
Problem 1: Create a program that
will display the sum of 2 numbers
Problem 6: Create a program that 1. Let numOne=0, numTwo=0,
will display Free or Not Free to and sum=0
enter the resort if free is 3ft and 2. Input numOne and numTwo
below 3. Sum = numOne + numTwo
1. Declare a variable for height 4. Output sum
2. Let the user input the height Problem 2: Create a program that
3. If the height is 3ft and below, will display the average of 2
display “Free” numbers
4. If the height is above 3ft, 1. Let numOne=0, numTwo=0,
display “Not Free” sum=0, and ave=0
2. Input numOne and numTwo
UNDERSTANDING 3. Sum= numOne + numTwo
PSEUDOCODE 4. Ave = sum/2
5. Output ave
Problem 3: Create a program that
Pseudocode
will display Even or Odd
- Method that allows a
depending on the number
programmer to represent
inputted by the user
algorithm in a more
1. Let num=0
programming related way
2. Input num
- It’s called “false codes”
3. IF num is even THEN
because it tends to look like a
Output “Even”
programming language but
4. IF num is odd THEN
can be understand by
Output “Odd”
someone who has little
Problem 4: Create a program that
knowledge about
will display the greater between
programming
two numbers
How to Write Pseudocode
1. Let num1 and num2 =0
1. Capitalize key commands (IF
2. Input num1 and num2
number is >10 THEN)
3. IF num1>num2 THEN
2. Write one statement per line
Output “greater is”, num1
3. Use indentation
4. IF num2>num1 THEN
4. Be Specific
Output “greater is”, num2
5. Keep it Simple
Problem 5: Create a program that
Do’s and Dont’s
will display the gender depending
● Do
on the inputter variable of the
1. Proper naming
user. Display Male if the number
convention
entered is 1 and Female if 2. If not
2. Keep it simple and
1 or 2 display Qplus
concise
1. Let num=0
● Dont
2. Input num
1. Don’t make it abstract
3. IF num=1 THEN
2. Don’t generalize it
Output “Male”
4. IF num=2 THEN Initialization block
Output “Female” - Used for declaring/initializing
5. IF num!=1 or 2 THEN variables needed to solve a
Output “Qplus” certain process
Problem 6: Create a program that - Declaration: stating a
will display Free or Not Free to variable name to be
enter the resort, if free is 3ft and used; names only
below
1. Let height=0
2. Input height
3. IF height <3ft THEN
Output “Free” -
4. IF height >3ft THEN - Initialization: to set (a
Output “Not Free” starting variable); name
with value
UNDERSTANDING
FLOWCHART

Flowchart
- Graphical representation of a -
sequence of operation Process Block
- Contains symbols describing - Rectangle indicates a
how an algorithm or program processing block for such
operates things such as calculate,
Flow Lines opening, and closing files
- Indicated by straight lines
with arrows to show the
direction of data flow
- Used to connect by exiting
from one and entering
-
another
Input/Output Block
- The parallelogram indicates
the input and output
- operator
Terminal block
- Ovals or rounded rectangles
are used to indicate the start
and end of a program
- -

Decision Block
- Diamond indicates a decision
- It has one exit and exactly
two exits from the block
- One exit is the action when 3 BASIC FLOWCHART
the resultant is TRUE and the STRUCTURE
other exit is the action when
resultant is FALSE Structure
- Basic unit of programming
logic
1. Sequence Structure
- Performs action in
order
- No branching or
- skipping any task
Connectors -
- Circle is used as a connection
point between two sections
of a flowchart that are not
adjacent or closely located to
each other
- Should be used as little as
possible
- Should be used to enhance
as reading
- Used if flowchart is too long
2. Selection Structure (decision
structure)
- Ask a question, take
one of two actions
- Dual-alternative ifs or
- single-alternative ifs
● Single Alternative Selection
Structure
EXAMPLES ○ Even if two responses
can be given only one
Problem: Create a program that response is
will display even or odd depending taken/needed
on the problem


● Dual Alternative Selection
Structure
○ Performs two different
things when the
condition is true or false
● Do-while Loop
- The action/statement is
executed first before
asking the condition
- Ito yung wala ka pang
ginagawa mali ka na

● Multiple Decision (Multiple


Alternative Selection
Structure)

EXAMPLE OF WHILE AND


DO-WHILE

3. Loop/Repetition Structure
- Perform a specific
action/statement a
number of times until a
condition is satisfied
● While Loop
- Statement or block of
statement that is
repeated as long as
some conditions is
satisfied
- Nauuna yung condition
before
action/statement
● For Loop 6. Unary Operators
- Executes an - Operators that perform
action/statement operations on a single
repeatedly operand to produce a
- Applications: reading new value
through a list of data - Unary Plus:
items or initializing an represented using
array symbol +, which does
not change to the
operant values and
always represents the
operands’ values
(Syntax)
- Unary Minus:
represented by using
the symbol -, changes
TERMS CONCERNING FOR LOOP the sign of its
1. Iteration argument (negative to
- Repeated execution of positive, positive to
some groups of code negative)
statements in a TYPE OF UNARY OPERATORS
program 1. Unary Minus ( - )
2. Initialization 2. Increment ( ++)
- Declare any variables 3. Decement ( -- )
used to initiate the 4. NOT ( ! )
procedure 5. Address of Operator ( & )
3. Condition 6. Size of ()
- Is in the middle, it’s FOR LOOP METHOD A1 (COUNT --)
here that you’ll need to
specify the variable’s
condition
- Block of code will get
executed if specified
condition is ‘true’, loop
is skipped if ‘false’
4. Increment/Decrement
- The loop’s body is
executed
- Variable is either
increased or FOR LOOP METHOD A2 (COUNT --)
decremented
5. Arithmetic Operators
- Following arithmetic
operators are
supported by C++
language
FOR LOOP METHOD A3 (COUNT --) 30 na lalagay mo “>30”
or “!=30”)
3. For loop Method B
- The number on both
the counter and
decision block will be
the ones in the
problem (e.g 35 down
to 30, counter will be 35
and decision block will
FOR LOOP METHOD B (COUNT --) be 30)
Draw a flowchat that will print the
numbers 30 to 35
FOR LOOP METHOD A1 (COUNT++)

TIPS FOR (COUNT --)


1. For Method A1
- Counter will always be
one number higher
than the highest
number (e.g 35 yung sa
problem so 36 counter
mo)
- For decision block,
always one number
higher than lowest FOR LOOP METHOD A2
number (e.g hanggang (COUNT++)
30 lang yung need
ishow so magiging
“>=31”)
2. For Method A2 and A3
- Counter will always be
one number higher
than the highest
number (e.g 35 yung sa
problem so 36 counter
mo)
- For the decision block,
the last number you
need to show will be
the number (e.g 30
yung nasa problem so
FOR LOOP METHOD A3 2. For Method A2 and A3
(COUNT++) - Counter is one number
less than given (e.g 30
will be 29)
- Decision block will be
the given (e.g 30 to 35,
it will become “<35” or
“!=35”)
3. For Method B
- The number on both
the counter and
decision block will be
the ones in the
problem (e.g 30 to 35,
counter will be 30 and
decision block will be
35)
FOR LOOP METHOD B (COUNT++) GENERAL TIPS
● The trace table’s order
(Counter, Count++, Output, If
Counter) is based on the
order of your flowchart
● If count -- , it uses greater
than sign “>” and is always
one number more in terms of
Method A counter
● If count ++, it uses less than
sign “<” and is always one
number less in terms of
Method A counter
● Both count -- and count ++
uses the problem as the
numbers for counter and
decision block when using
Method B

TIPS FOR (COUNT ++)


1. For Method A1
- Counter and decision
block are one number
less than the given (e.g
30 to 35, counter will be
29 and decision block
will use 34

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy