Professional Documents
Culture Documents
Why is it important?
1.) Accuracy
2.) Consistency
3.) Efficiency
- Space required
- Time required
• Input - the stage where external data flows into the process
• Process - the stage where data is worked upon
• Output - the stage where data flows from the process
• Storage - the stage where data is stored
• Decision – determines whether the condition is met
Input/ Decision
Process Storage
Output
, , ,
Example: Decision
Storage
Functions
- Small units of program
- Used to carry out specific tasks
Comments
- Enclosed in /*…*/
Computer program
• Strings - “Hello”
• Characters - “n”
• Whole numbers - “9”
• Decimal numbers - “0.1”
Programming Languages:
- Java
-C
- C++
- Python
C Loops
- Allows a set of instructions to be repeatedly executed until a certain condition is met
3 Types of Loops
1. For loop
…
for ( initialization ; condition ; increment )
{
statement(s);
}
…
2. While loop
…
while ( condition )
{
statement(s);
}
…
3. Do while loop
…
do {
statement(s);
} while ( condition );
return 0;
True Break
Process Condition
False
• Continue statement “continue;” - forces the next iteration of the loop to take place, skipping
any code before it
True False
Condition Continue Statement End
False True