You are on page 1of 4

1.

) Computational Thinking Skills

- allows us to take a complex problem and develop possible solutions

4 steps in computational thinking skills

1.) Decompose - breaking the problem into smaller, manageable ones


2.) Pattern Recognition
3.) Abstraction - ignoring details that make things different
4.) Algorithm - formulate a set of steps that solves the problem

Why is it important?

1.) To retain control


2.) We become confident
3.) We learn not to be overwhelmed

2.) Properties of Algorithms

- a set of steps or instructions to complete a task


- not a computer program, but is implemented by computer programs

3 Qualities of a Successful Algorithm

1.) Accuracy
2.) Consistency
3.) Efficiency
      - Space required
      - Time required

3.) Flow Chart Symbols and Functions

• 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

Input Process Output

Storage

4.) Signs and Symbols used in Programming

1. Ampersand “&” - used to assign a value to a variable


2. Octothorpe “#” – preprocessor directive

5.) Functions used in Programming

Functions
- Small units of program
- Used to carry out specific tasks

• main() - the entry point of the program


• printf() - displays an output
• scanf() - takes an input
• return 0; - the “exit status”, it ends the program

Comments
- Enclosed in /*…*/

6.) Different types of Data and its Character Symbols

Computer program

- a sequence of algorithms; program source code


- also called Computer Software
- can range from 2 to a million lines of instructions

Python data types:

• Numbers - specifies all types of numbers including decimal


• String - a sequence of characters with a length of one or more
• List
• Tuple
• Dictionary
Different types of Data:

• Strings - “Hello”
• Characters - “n”
• Whole numbers - “9”
• Decimal numbers - “0.1”

Programming Languages:

- Java
-C
- C++
- Python

C and Java Data types:

Type Keyword Format Identifier


Character char %c
Number Int %d
Small number short %lf
Long double long %Lf
Decimal number float %f

7.) Different Types of Loops

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;

• Infinite loop - a condition that never becomes false



for( ; ; )
{
statement(s);
}

8-9.) Control Structures and Statements

• Break statement “break;” - terminates the loop or switch statement

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

You might also like