Professional Documents
Culture Documents
COMPUTER
- General purposes machine that performs computational tasks
- Can’t do anything on their own/ without instructions
- Executes the program
PROGRAM
- Step-by-step information to perform tasks
- Uses programming languages
PROGRAMMER
- The one who writes the program
Binary Language
- Uses 0 and 1 values
- Easier to create for the hardware level (1 = exists; 0 = doesn’t exists)
- Machine language
PROGRAMMING LANGUAGES
- A language that a computer understands
COMPILATION/INTERPRETATION
int (Integer)
- whole numbers that can have both zero, positive and negative values but no decimal
values
- size: usually 4 bytes (32 bits)
float and double
- used to hold real numbers (with decimals)
- float size: 4 bytes
- double size: 8 bytes
char
- used for declaring character type variables
- size: 1 byte
void
- "absent" , "nothing" , or "no type"
scanf() function
- to take input from the user
printf() function
- a library function that displays output to the user
if...else Statement
(Process)
- If the result is true or the condition was satisfied: the if statement will be executed while
skipping the else statement.
- If the result is false or the condition was not satisfied: the else statement will be executed
and the if statement will be ignored.
(ex)
Other types of if…else Statements
- if...else Ladder
(ex.)
- Nested if...else
(to include an if...else statement inside the body of another if...else statement.)
NOTE: If the body of an if...else statement has only one statement, you do not need to use
brackets {}.
C Switch Statement
- an alternate to if-else-if ladder statement which allows us to execute multiple operations
(ex)
(ex2)
(Rules)
1) The switch expression must be of an integer or character type.
2) The case value must be an integer or character constant.
3) The case value can be used only inside the switch statement.
4) The break statement in switch case is optional.
ALGORITHM, PSEUDOCODE, AND FLOWCHART
Source code
- programming statements that are created by a programmer with a text editor or a visual
programming tool and then saved in a file.
(ex)
Algorithm
- Step-by-step process to solve a problem with the use of simple terms in the form of a
sentence/paragraph.
- Formal form (detailed)
(ex)
Pseudocode/ Pseudo Code
- Step-by-step process to solve a problem that uses technical terms.
- Informal form (not detailed)
(ex)
Flowchart
- Pictorial form of step-by-step process to solve a problem.
- Uses flowchart symbols/ algorithm vocabulary
(ex)
Flowchart Symbols/ Algorithm Vocabulary
Page 1 Page 2