Tle Reviewer
Tle Reviewer
● Computational practices
a) Experimental and iterating: developing a little bit, the trying it out,
then developing more
b) Testing and debugging: making sure things work - and finding and
solving problems when they arise
c) Reusing and remixing: making something by building on existing
project or ideas
d) Abstracting and modularizing: exploring connections between the
whole and the parts
● Computational perspectives
a) Expressing: realizing that computational is a medium of creation, “I
can create”
b) Connecting: recognizing the power of creating with and for others, “I
can do different things when I have access to others”
c) Questioning: feeling empowered to ask about the world.
LESSON 2: ALGORITHM
● An algorithm is “a finite set of precise instructions for performing a
computation or for solving a problem”
● A program is one type of algorithm
- All programs are algorithms
- Not all algorithms are programs!
● Properties of algorithm
- Input: what the algorithm takes in as input
- Output: what the algorithm produces as output
- Definiteness: the steps are defined precisely
- Correctness: should produce the correct output
- Finiteness: the steps required should be finite
- Effectiveness: each step must be able to be performed in a finite
amount of time
- Generality: the algorithm should be applicable to all problems of a
similar form
Types of algorithm
● DIVIDE AND CONQUER ALGORITHM - divide the problem into smaller
subproblems of the same type; solve those smaller problems and combine
those solutions to solve the original problem.
1. Divide: Divide the given problem into sub-problems using recursion.
2. Conquer: Solve the smaller sub-problems recursively. If the
subproblem is small enough, then solve it directly.
3. Combine: Combine the solutions of the sub-problems that are part of
the recursive process to solve the actual problem.
LESSON 3: VARIABLES
● Variables in programing
- A variable can be set and changed while a program is running.
● What can a variable hold
- A variable is a placeholder in the memory of a computer. It can hold
one value at a time.
- Each variable in a program is named.
RULES
- a letter
- a combination of letters
- a combination of letter(s) and number(s)
- a combination of letter(s) and number(s) and underscore
Examples: A, sum, num12,
crush_mo_siya_1
Change a value
● If the value of a variable is changed, the new value replaces the
previous value.
● It’s time to change your values. Remember to remove the previous
values and destroy them!
Naming variables
● To help when programming, variable names should be short and unique.
They should contain underscores instead of spaces. For example,
Home_team
Types of variables:
● “Variables” are simply storage locations for data
● All operations on variables are performed with consideration of what the
variable's "Type" is
● There are rules that define what operations are legal in order to maintain the
integrity of the data you put in a variable
Primitive Data:
● There are eight primitive data types
● Four of them represent integers:
- byte, short, int, long
● Two of them represent floating point numbers:
- float, double
● One of them represents characters:
- char
● And one of them represents boolean values:
- boolean
1. BOOLEAN TYPE - Boolean types are declared using the keyword, bool
- They have two values: true or false
2. INTEGRAL TYPES
● An integral is a category of types.
● They are whole numbers, either signed or unsigned, and the char type
is a Unicode character, as defined by the Unicode Standard
4. STRING TYPE
● A string is a sequence of text characters.
● You typically create a string with a string literal, enclosed in quotes:
"This is an example of a string."
● Some characters aren't printable, but you still need to use them in
strings.
LESSON 4: CONSTANT
● CONSTANT
-Values that do not change while the program is running
-They are very effective when, for example, you have a number that you
want to use over and over again, you can simply use a constant name
instead of typing the numbers every time you need it.
- EXAMPLE:
Dollar = 45.50
Pi = 3.1416
Name= “Jhera”
School = “Santa Rosa Science and Technology High School”
● TYPES OF CONSTANT
- REAL OR FLOATING CONSTANT - Constants are fixed values that
do not change during the execution of a program. A real constant is a
combination of a whole number followed by a decimal point and the
fractional part. Example: 0.0083 -0.75 .95 215.
- USE OF REAL OR FLOATING-POINT CONSTANT - Integer numbers
are inadequate to represent quantities that vary continuously, such as
distances, heights, temperatures, prices and so on. These quantities
are represented by numbers containing fractional parts. Such numbers
are called real or floating point constants.
- The Real or Floating-point constants can be written in two forms:
A. Fractional or Normal form - A real constant consists of a series of
digits representing the whole part of the number, followed by a decimal
point, followed by a series representing the fractional part. The whole
part or the fractional part can be omitted, but both cannot be omitted.
The decimal cannot be omitted. That is, it is possible that the number
may not have digits before the decimal point or after the decimal point.
RULES:
RULES
● A string constant may consist of any combination of digits, letters, escaped
sequences and spaces enclosed in double quotes.
● Every string constant ends up with a NULL character which is automatically
assigned (before the closing double quotation mark) by the compiler.
Numeric constants: There are two types of numeric constants: Integer constants
and Real or floating-point constants
Integer constants
- Any whole number value is an integer.
● An integer constant refers to a sequence of digits without a decimal point.
● An integer preceded by a unary minus may be considered to represent a
negative constant
Example: 0 -33 32767
● ELLIPSE (START/END)
➢ it is represented by an ellipse.
➢ It appears at the start and the end of a flowchart.
➢ It only appears once in a given flowchart.
● PARALLELOGRAM (INPUT/OUTPUT)
➢ It is represented by a parallelogram
➢ It represents input or output.
● RECTANGLE (PROCESS)
➢ It is represented by a rectangle.
➢ It represents an individual step or activity in the process.
● DIAMOND (DECISION)
➢ It is represented by a diamond.
➢ It represents a process of decision that can be answered by YES or
NO.
● CIRCLE (CONNECTOR)
➢ It is represented by a circle.
➢ It indicates that a particular step or process is connected to another
page or part of a flowchart. It ensures the continuation of the process,
logically and accurately.
● ARROW (FLOW)
➢ It is the representation of the FLOW of the process. Keeping the
relation of processes clear.
➢ It is drawn, preferably, from top to bottom.
- advantages :
a. Use of English-like words makes it a human-
understandable language.
b. Lesser number of lines of code as compared to above 2
languages.
c. Same code can be copied to another machine &
executed on that machine by using compiler-specific to
that machine.
- Disadvantages :
a. Compiler/ interpreter is needed.
b. Different compilers are needed for different machines.