Computer Science Core Concepts
What is Computer Science? Computer Science is the creation and adaptation of technology
What is programming?
Instructions for a computer to follow to perform a task Programming Instructions for a computer to follow to perform a task
What is an algorithm?
Algorithms A process to follow to solve a problem; a set of instructions
What is A variable?
Variable A symbol or name that represents a value Can declare, assign or change the value of variables
What is Boolean?
Boolean A data type that returns only true or false. It will not return numbers*, words, etc.. True=1 False=0 *the only numbers Boolean will return
What is A Comparator?
Comparators (aka Logic operators) Compare two or more Variables The result of the comparison is a boolean value Equal to == and Not equal to != or Greater than > not Greater than or equal to >= Less than < Less than or equal to <=
Comparators (con’t) x = 10 y = 20 What is the boolean value of the following expressions? x == y x != y x > y x >= y x < y x <= y
What is An if-else statement?
If-Else Statements When a comparison is True, then the if- block will be executed. And, if a comparison is False, then the else- block will be executed.
If-Else Statements examples y = 4 What is the boolean value of the following expressions? if (x > y and y != 5) if (x < y or x >= 5) print (“Hello!”) print (“Hola!”) else else print (“Bye!”) print (“Adios!”) if ((x-y)==4) print (“Bonjour!”) else print (“Au revoir!”)
What is Branching?
Branching A branch is a set of instructions that, when executed, cause the computer to begin execution of a different instruction sequence. Branching can use if-else or switch statements
What is a loop?
LOOPS Series of instructions that is repeated until a given condition is false
LOOPS (Types) for loop: executed at least once, and the number of repetitions is known while loop: repeatedly executed statement; will be executed 0-infinity times
What is iteration?
Iteration Iteration is the act of repeating a process Each time a loop runs, that is one iteration.
What is a function?
Functions A small set of instructions that defines how to complete a specific task The “Add ten to a number” is the function
You learned about ... Computer Science Programming Algorithm Variable Boolean Comparators If/Else Loops For Loop While Loop Iteration Function
Review!